Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can run Sublime, for example, in the background by typing

sublime-text &

The & puts it into the background so that I can continue to run commands in my terminal. Alternatively, I can run


Which locks up my terminal. If I then press Ctrl+Z it "suspends" the application which essentially freezes it (it will eventually turn gray). Typing bg moves it into the background and unlocks the terminal.

In any case, if I exit the terminal or type fg and then Ctrl+C, the application will close.

How do I "disconnect" the GUI application from the terminal so that it will not close should I close the terminal or press Ctrl+C? In other words, I would like to use the terminal as a launcher, which is particularly convenient when I want to open a specific file: e.g., sublime-text /path/to/my/file <super-secret-character-that-disconnects-the-app-not-just-puts-it-in-the-bg>.

share|improve this question
How about using XTERM instead of the Normal Terminal – Tasos Mar 25 '14 at 22:55
@Tasos: You're going to have to elaborate on that. I've only got a vague idea of what xterm is, and I don't know how it solves this particular problem. – mpen Mar 25 '14 at 23:46
Its an alternative to a terminal. Its comes with Ubuntu and does the same stuff as a Normal terminal. Doesn't Sublime come with an Icon anyway you can start it that way or do you actually need the Terminal for some reason i didn't understand? – Tasos Mar 25 '14 at 23:58
Could you please explain how/why is it more convenient to use sublime-text /path/to/my/file <super-secret-character-that-disconnects-the-app-not-just-puts-it-in-the-bg> from a terminal than double-clicking (or right-click, open with) the filename in a file manager? – DK Bose Mar 26 '14 at 1:53
@DKBose I too launch my editor mostly by command line; I can use tab completion, shell variables, gobbling for multiple files, find tricks... Infinitely faster than browsing the graphical file manager. For example gvim -p convert*.[ch]... – Rmano Mar 26 '14 at 5:06
up vote 3 down vote accepted

You can use disown command to detach background processes from the terminal.

If you have only one running background job, you can simply use


and the owner of this background process will no longer be the terminal, so it will keep running even after the terminal is closed.

share|improve this answer
So, a more concise way might be: sublime-text ~/.zshrc&; disown – mpen Mar 26 '14 at 16:03
Yes. sublime-text ~/.zshrc & disown. This way it just works fine for me. – cgty Mar 26 '14 at 16:36

Under bash, use the disown command to fix an existing process. To get the list of background processes attached to the current shell, use the jobs command. Then to disown the desired process, use disown % <job number>. Below is an example of how to disown xload.

[1]+  Stopped                 man man
[2]-  Running                 xload &
[3]-  Running                 xeyes &

disown %2

To prevent the problem from the start, use the nohup command. So I would add this line to your .bashrc file:

alias sublime-text='nohup sublime-text'  

Then type sublime-text < filename> &.

share|improve this answer
This prints an annoying message, "nohup: ignoring input and appending output to ‘nohup.out’" – mpen Mar 26 '14 at 16:00

nohup gedit &. Now you can just press enter to continue entering commands and stuff and if you close the terminal, gedit will stay open.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.