{"id":136,"date":"2010-06-07T09:34:19","date_gmt":"2010-06-07T09:34:19","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=136"},"modified":"2010-06-07T09:34:40","modified_gmt":"2010-06-07T09:34:40","slug":"running-processes-as-background-jobs","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=136","title":{"rendered":"Running processes as background jobs"},"content":{"rendered":"<h1><span style=\"font-weight: normal; font-size: 13px;\">To run a process in the background as a\u00a0<em>job<\/em> and carry on working add an\u00a0<samp>&amp;<\/samp> (ampersand) at the end of the command line. For example:<\/span><\/h1>\n<pre>   <strong>find \/usr\/man -name *.1 -print &gt; sect1 &amp;<\/strong>\r\n   [1] 2548<\/pre>\n<p>The shell forks a child process to run the command and displays the job number (<samp>[<\/samp><em>n<\/em><samp>]<\/samp>) and the PID (Process IDentifier) number. The shell prompt returns and you can enter further commands.<\/p>\n<p>Redirect the\u00a0<a href=\"http:\/\/unixhelp.ed.ac.uk\/commanz\/cmd3.2.html\">standard output<\/a> for a command that is being run in the background to a file. This prevents the output from the command appearing on your screen and interrupting your current work.<\/p>\n<p>If the command is likely to produce error messages you will need to redirect standard error. Otherwise all error messages are sent to your screen.<\/p>\n<p>Do not run an interactive command that requires you to type something at the terminal as a background job. If you do the job will stop and wait for user input. You will then have to kill it&#8217;s process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To run a process in the background as a\u00a0job and carry on working add an\u00a0&amp; (ampersand) at the end of the command [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}