send foreground job/running process to run in background

1.Moving Linux job from Foreground Into background :

  • start the program
  • Ctrl+Z (Will pause the program on the terminal)
  • jobs (find the job number from current shell)
  • bg  %jobnum

 

NOTE : Here we are only sending the process into background but exiting the programe still use the child shell of the current shell. So exiting the shell/terminal will kill the process.

 

2. Moving Linux jobs into background(nohup mode, freeing the shell)

  • Start the program
  • Ctrl+Z (Will pause the program on the terminal)
  • bg to run it in the background
  • disown -h ( shell disowns the process and will not get SIGHUP, so its kind of nohup mode)
  • exit (To exit from the shell)
  • Check in other terminal if the process is still running

 

NOTE : Here  running process is moved into background, and exiting the shell will not kill the process and will still run.

Advertisements

About Divyashree - The GNULINUX Guy

I am a Linux and Opensource enthusiast. I started working on Linux early in 2007 while I was doing my Masters in Computer Science and passed out in 2010. Currently working as a DevOps in in Public/Private cloud domain. my @github : https://github.com/kumarprd my @nagiosexchange : https://exchange.nagios.org/directory/Owner/divyaimca/1 my @linkedin : https://www.linkedin.com/in/priyadarshee-kumar-☁-a9415615
This entry was posted in HOWTO, OperatingSystem, TIPS & T RICS, TUTORIALS, Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s