Skip to content

Instantly share code, notes, and snippets.

@narutaro
Last active October 29, 2015 05:59
Show Gist options
  • Save narutaro/0c0e13f9dcb3ac1ec553 to your computer and use it in GitHub Desktop.
Save narutaro/0c0e13f9dcb3ac1ec553 to your computer and use it in GitHub Desktop.
Detouch terminal while running a job

#Situation You have a running job which is taking longer time than expected and you gotta hit a road now. However, you don't want to stop the job cause it run long already.

#Solution This is what you can do.

  1. Ctrl+Z and put the job back ground
  2. Check the job id with jobs
  3. disown the job
[you@nttlab-10-dev-analyze-001 result002]$ sudo mv 2015-09-0* /data/out/result002/
^Z
[1]+  Stopped                 sudo mv 2015-09-0* /data/out/result002/
[you@nttlab-10-dev-analyze-001 result002]$ jobs
[1]+  Stopped                 sudo mv 2015-09-0* /data/out/result002/
[you@nttlab-10-dev-analyze-001 result002]$ disown %1
-bash: warning: deleting stopped job 1 with process group 17676

The job will keep running even after you close your terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment