Run process in background in linux
Run the following command:
nohup SOME_COMMAND & > nohup.out 2>&1
For example:
nohup scp some_big_file.tar.gz james@myserver.com:~/ > nohup.out 2>&1
Then press Ctrl + z. This will temporarily suspend the command.
Run the command to start the real background process
bg
Written by James Huynh
Related protips
3 Responses
better:
nohup SOME_COMMAND > nohup.out 2>&1 &
then you do not need steps I and II ;-)
over 1 year ago
·
please make sure/check that/whether your current shell doesn't send a KILL signal instead of HUP if you want to exit / logout from your interactive shell. Sometimes there are exceptions!
over 1 year ago
·
you can also try :
command & disown
to let the process run in the background and still work if you close the terminal
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Command line
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#