Linux: Stop Programs Quitting When the Terminal Is Closed

Posted on in Categories , , , , , , , , , , last updated October 22, 2008

Q. When I start a program from the terminal, it closes when I close the terminal windows? How do I stop program quitting when the terminal is closed?

A. You need to use nohup utility, which allows to run command./process or shell script that can continue running in the background after you log out from a shell:
nohup program &
nohup gedit file.c &

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Leave a Comment