{"id":1324,"date":"2012-09-05T15:46:41","date_gmt":"2012-09-05T07:46:41","guid":{"rendered":"http:\/\/rmohan.com\/?p=1324"},"modified":"2012-09-05T15:46:41","modified_gmt":"2012-09-05T07:46:41","slug":"job-control","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1324","title":{"rendered":"Job Control"},"content":{"rendered":"<p>View the currently running jobs:<br \/>jobs<\/p>\n<p>Place running foreground process into background:<br \/>ctl-z #puts the job to sleep<br \/>bg %1<\/p>\n<p>Bring a background job into the foreground:<br \/>fg %1<\/p>\n<p>Kill a job:<br \/>kill %1<br \/>kill %1 -9<\/p>\n<p><strong>Find the PID of all jobs<\/strong><br \/>jobs -p<br \/>jobs -pl<\/p>\n<p><strong>Bring a nohuped process to the foreground<\/strong><br \/># note: I think you can only do this from the same terminal session.<br \/># It doesn&#8217;t look like it is possible to nohup a process, close a terminal<br \/># and then bring the process back to the foreground again. Use screen instead.<\/p>\n<p># If you do not close your terminal session and if you do something like<br \/>nohup sleep 100 &amp;<br \/># and want to bring this to the foreground<br \/># find the process ID using<br \/>jobs -p<br \/>or<br \/>ps -ef<br \/># then supply the PID as the argument to the fg command<br \/>fg 14389420<\/p>\n","protected":false},"excerpt":{"rendered":"<p>View the currently running jobs:jobs<\/p>\n<p>Place running foreground process into background:ctl-z #puts the job to sleepbg %1<\/p>\n<p>Bring a background job into the foreground:fg %1<\/p>\n<p>Kill a job:kill %1kill %1 -9<\/p>\n<p>Find the PID of all jobsjobs -pjobs -pl<\/p>\n<p>Bring a nohuped process to the foreground# note: I think you can only do this from [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1324"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1324"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1324\/revisions"}],"predecessor-version":[{"id":1326,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1324\/revisions\/1326"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}