launching a task from cli and "divorcing it from terminal task
How do you launch a task from a terminal command line interface and it not be kill'ed if you close the terminal window.
Like if I run jedit I type jedit & which launches jedit as a backgorund task. But, if I close terminal window, jedit dies to. How do I laucnch jedit and completely divorce it from the terminal task? tj |
use nohup
Like this: Code:
nohup jedit & |
Bash also has a disown builtin command that lets you detach a process after you've launched it. ctrl+z to pause the process, then run bg to send it to the background, and finally run disown, and it will be "forgotten" by the shell.
If you want to be able to detach a process and re-attach to it later, consider using screen. |
I didn't know about the disown command.
|
Thanks to both of you.
nohup worked as suggested with jedit. Had to try another app to disown since jedit automatically placed itself in background. But, worked as stated on another app. Thanks again tj |
Mark the thread as solved.
|
You can get a list of all background processes running in a shell with the jobs command. Then you can address any of those jobs with disown %n, "n" being the number of the job you want. Or use disown -a to detach all of them.
Check out help disown or the SHELL BUILTIN COMMANDS section of the bash man page, and read up on job control. |
All times are GMT -5. The time now is 04:31 PM. |