What if you have a program that you’d like to run in the background remotely after you’ve exited from your terminal/shell prompt?
Use the nohup
command!
Run:
nohup some-command &
Maybe you have a python script called server_receive.py
, you should run nohup python server_receive.py &
. The “&
” symbol is required so that the process will enter the background.
You can later terminate it by running ps aux
to obtain the process id, and calling kill -9 1234
, if the process id is 1234.