Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How can I run a command which will survive terminal close?

Sometimes I want to start a process and forget about it. If I start it from the command line, like this:
redshift


I can't close the terminal, or it will kill the process. Can I run a command in such a way that I can close the terminal without killing the process?
by

2 Answers

akshay1995
One of the following 2 should work:

$ nohup redshift &

or

$ redshift &
$ disown

See the following for a bit more information on how this works:

man nohup

help disown
sandhya6gczb
If your program is already running you can pause it with Ctrl-Z, pull it into the background with bg and then disown it, like this:

$ sleep 1000
^Z
[1]+ Stopped sleep 1000
$ bg
$ disown
$ exit

Login / Signup to Answer the Question.