Sunday, November 13, 2011

How To Close The Terminal Without Closing The Running Program

If you start a program with the Terminal under Ubuntu, it will close once you exit the Terminal. If you want to keep an application started with the Terminal running, then follow these instructions:

1. Start any application with the Terminal. Let's take an example the Synaptic Package Manager, run it via the Terminal (Ctrl+Alt+T) with this command:

sudo synaptic

2. If you close the Terminal, Synaptic will also exit. To fix this, in the Terminal window, press Ctrl+Z, then run these commands:

disown -h %1
bg 1

3. You can now close the terminal securely, the application will stay running. That's it!