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.

Leave a Reply