{"id":673,"date":"2012-10-19T17:10:51","date_gmt":"2012-10-19T17:10:51","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=673"},"modified":"2016-02-03T16:36:38","modified_gmt":"2016-02-03T16:36:38","slug":"command-line-general","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/command-line\/command-line-general","title":{"rendered":".Command Line General"},"content":{"rendered":"<h4>\nGood Resources<br \/>\n<\/h4>\n<p>\n<a href=\"http:\/\/switch.dl.sourceforge.net\/project\/linuxcommand\/TLCL\/09.12\/TLCL-09.12.pdf\" target=\"_blank\">The Linux Command Line &#8211; free pdf book<\/a>\n<\/p>\n<h4>\nGet previously entered commands<br \/>\n<\/h4>\n<p>\nUse the up and down cursor keys.\n<\/p>\n<h4>\nIssuing multiple commands in a single line<br \/>\n<\/h4>\n<p>\nIf subsequent commands should only occur if the previous command succeeded use &quot;&amp;&amp;&quot;:\n<\/p>\n<pre>\r\n<code>\r\nsudo ifdown eth0 &amp;&amp; sudo ifup eth0\r\n<\/code><\/pre>\n<p>\nIf subsequent commands should occur regardless of whether the previous command succeeded use &quot;;&quot;&nbsp;:\n<\/p>\n<pre>\r\n<code>\r\nsudo ifdown eth0 ; sudo ifup eth0\r\n\u200b<\/code>\r\n<\/pre>\n<h4>\nIssuing Commands In The Background<br \/>\n<\/h4>\n<p>\nTo issue a command and exit immediately you can simply&nbsp;add a space followed by a &#39;&amp;&#39; character at the end of the line. &nbsp;If the command has responses that come later they will still be output to the console (you&#39;ll see them) but you will be free to use&nbsp;the console for other tasks commands.\n<\/p>\n<p>\nIf you want to issue multiple commands simple surround the &#39;;&#39; seperated commands in brackets and follow with a &#39;&amp;&#39;, e.g.:&nbsp;(sleep 2 ; sudo \/sbin\/reboot ) &amp;\n<\/p>\n<h4>\nGetting error and normal responses<br \/>\n<\/h4>\n<p>\nSimply add &quot; 2&gt;&amp;1&quot; to the end of your command string and you will then get the output of stdout and stderr\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good Resources The Linux Command Line &#8211; free pdf book Get previously entered commands Use the up and down cursor keys. Issuing multiple commands in a single line If subsequent commands should only occur if the previous command succeeded use &quot;&amp;&amp;&quot;: sudo ifdown eth0 &amp;&amp; sudo ifup eth0 If subsequent commands should occur regardless of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-673","post","type-post","status-publish","format-standard","hentry","category-command-line"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=673"}],"version-history":[{"count":9,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/673\/revisions"}],"predecessor-version":[{"id":2509,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/673\/revisions\/2509"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}