|
Normally when you use the terminal all with run a program, if you want close terminal, this will also close the running program. To avoid this behavior, there is a small trick. |
Suppose you opened nautilus from a terminal by running:
Nautilus
Now you want to close the terminal without closing the Nautilus window. To do this, press Ctrl + z in the terminal and run the following commands:
disown -h% 1
bg 1
Once that is done, you can close the terminal without affecting the program you opened from the terminal.
As Rafa (one of our readers) suggests, another similar method but that does not have exactly the same effects is to add the parameter & at the end of the command you want to execute. For example, to open nautilus it would be like this:
nautilus &
This means that you can continue to use the terminal after running the program but, unlike the previous method, closing the terminal will also close the executed program.