If i wanted to run an application from the terminal (linux, ubuntu), how do I do so so that the terminal is still usable or that so if I close the terminal, the application still runs.
Asked
Active
Viewed 7.6k times
1 Answers
41
If you just want to use the terminal interactively again, run the command in the background by appending &
after the command:
some_command &
If you want the application to continue functioning after closing the terminal as well, use nohup
:
nohup some_command &
All STDOUT and STDERR will be redirected to the file $PWD/nohup.out
.
Or disown
:
some_command & disown
Both nohup
and disown
will make some_command
immune to SIGHUP
.
Check man nohup
and help disown
to get more idea on these.

heemayl
- 56,300
-
1I never knew about 'help' thanks. BTW, 'help' is built into bash to provide help on bash inbuilt commands. – philcolbourn Oct 14 '18 at 02:44
-
Wish these worked from the menu... – Andrew Apr 27 '19 at 23:49
-
Thanks! And is there a way to reconnect to it interactively? – Dr_Zaszuś Apr 02 '20 at 18:34