Putting a process to the background in Linux

Today i learned how one can detach a running process on linux or unix from the terminal. I know that you can do this on purpose by putting a ampersand: & behind the command. But that was not the question. You see i had a process running at 17:00 hours and it would take another hour before it was done. I wanted to go home before 18:00 yet i did not want to interrupt the process because it should finish. So CTRL-C was not an option.
But you can tell linux to detach the process from the terminal, you just do this simple steps

  • CTRL-Z (no this will not harm the process)
  • bg n

Where n is the job number that linux returns after you hit CTRL-Z. Linux will continue the process in the background (bg) and you can close the terminal session.

Syndicate content
thank you for watching  Creative Commons License