21

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.

0

1 Answer 1

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.

3
  • 1
    I never knew about 'help' thanks. BTW, 'help' is built into bash to provide help on bash inbuilt commands. Oct 14, 2018 at 2:44
  • Wish these worked from the menu...
    – Andrew
    Apr 27, 2019 at 23:49
  • Thanks! And is there a way to reconnect to it interactively?
    – Dr_Zaszuś
    Apr 2, 2020 at 18:34

Not the answer you're looking for? Browse other questions tagged .