You may have started an application from the terminal and noticed that those applications close when the terminal is closed. This article will help you stop that behavior. This should be a pretty basic and speedy article.
Let’s explain what I mean with a demonstration. First, open your terminal by pressing
1 | pcmanfm-qt |
Change the ‘pcmanfm-qt’ to the file manager you use, like ‘nemo’, ‘spacefm‘, or whatever it is you use to manage files in a graphical way. Any one will do.
Now, close the terminal that you used to open your file manager or application. When you do so, you’ll see that applications close when the terminal is closed. Well, it doesn’t have to be that way.
Enter ‘nohup‘, a lovely tool that will let you open applications in the terminal and then make sure that those applications don’t close when the terminal is closed. The ‘nohup’ application should be installed by default on any major distro and the man page describes it like:
nohup – run a command immune to hangups, with output to a non-tty
If you check the man page, you’ll see that it has pretty much no useful flags other than help and version. So, straight away you’ll see that it’s a pretty easy application to work with.
And, with that ease in mind, I’m just gonna go straight into telling you how to use it.
Applications Close When The Terminal Is Closed:
Seeing as you already opened the terminal, let’s not mess about and just show you some uses of ‘nohup’. Let’s say you use ‘nemo’ as your file manager:
1 | nohup nemo ~/Downloads |
Now close the terminal. See? When you use ‘nohup’ you’ll not have applications close when the terminal is closed.
You may see the command used with an ampersand (“&”) symbol at various tutorial sites. What that does is it runs things in the background. This means it should immediately return to the command prompt after the application has opened. This only works if you’re using bash, by the way. If you use it, it looks something like this:
1 | nohup nemo ~/Documents & |
Anyhow, after you’ve used ‘nohup’ to open an application without the ampersand, you can also just press
That’s about it, really. I don’t see any reason to stretch this article out by adding fluff. You’re welcome!
Closure:
There ya have it. Another article. This one will help you change the behavior, if you don’t want to have applications close when the terminal is closed.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.