1

Say I run an app from a terminal, but in some cases I want to close the terminal but hope the app keeps running.

Is there anyway to do so in Linux?

I just found that when calling an app via "exec APP", either would be closed if the other was closed.

marked as duplicate by slm, Anthon, Zelda, terdon, Bernhard Jan 5 '14 at 16:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

Start the application with:

nohup your_application &

It will continue running after you exit the terminal.

If you use tmux or screen and start the your_application from inside that, you can reattach to the "output" after closing the terminal and opening another.

1

You can also run the app normally, then hit Ctrl+Z to pause it and run bg to background it and then exit the terminal cleanly.

Cleanly means by running exit, not clicking on the close button. If you kill the terminal in any other way, it will close the app.

This works for me on Cinnamon (and other DEs) and bash. It fails with zsh.

  • Thanks, but I tried this with both zsh and bash with no success. I'm using archlinux and xfce4 if these matter. – Lagrange Jan 5 '14 at 15:34
  • 1
    @Lagrange darn, it's the second time I've posted this as an answer and it doesn't work. I've been doing this happily for ages on Debian and Mint and others and various DEs. Works on bash (not zsh) for me. Make sure you have sent the job to the background with bg after the Ctrl+Z (forgot to mention that). – terdon Jan 5 '14 at 15:49
  • cool! It works now, exactly what I want. Not for zsh, as you said, but it's no big deal. Thanks! Haven't collected my 15 reputations yet, may vote for you later. Cheers, – Lagrange Jan 5 '14 at 16:14

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