Skip to main content

Linux command: keep on running a process after exiting from a shell prompt

I logged in a server remotely via ssh and I wanted to keep my program running even after turning off my computer (i.e., exiting from the shell prompt that my program is running on).

nohup [command] > [file_output] &

(ignoring input and redirecting stderr to std out)

For example: I want to continue running my java process:
nohup java -jar cluster.jar > output.txt &


- To keep updated about the output file and display it:
tail -f output.txt

Note:
- if you want to kill this process, use: kill -9 $pid
- Thanks, BM :-)

Comments