{"id":32,"date":"2018-07-25T12:05:41","date_gmt":"2018-07-25T08:05:41","guid":{"rendered":"http:\/\/kidds.co.za\/?p=32"},"modified":"2018-07-25T12:28:17","modified_gmt":"2018-07-25T08:28:17","slug":"pausing-commands-and-running-commands-in-the-background","status":"publish","type":"post","link":"https:\/\/kidds.co.za\/index.php\/2018\/07\/25\/pausing-commands-and-running-commands-in-the-background\/","title":{"rendered":"Pausing Commands And Running Commands In The Background"},"content":{"rendered":"<figure id=\"figure-article_2-0-2\" class=\"comp figure-article figure-landscape\">\n<div class=\"figure-media\">\n<div class=\"img-placeholder\"><img loading=\"lazy\" decoding=\"async\" class=\" lazyloaded\" src=\"https:\/\/www.lifewire.com\/thmb\/SbnjFfC6zj1BygsVAofArZ8lkOA=\/768x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png\" srcset=\"https:\/\/www.lifewire.com\/thmb\/xT-zhkZ-Y5RurLtQq2-VKuDKa3Y=\/300x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 300w, https:\/\/www.lifewire.com\/thmb\/zQH7j1WDEP3mYppSK7d2YM9slRA=\/417x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 417w, https:\/\/www.lifewire.com\/thmb\/Is5deaziVO7-Sx4AWjwLNtr6JDA=\/534x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 534w, https:\/\/www.lifewire.com\/thmb\/SbnjFfC6zj1BygsVAofArZ8lkOA=\/768x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 768w\" alt=\"Pause Terminal Applications\" width=\"514\" height=\"289\" data-srcset=\"https:\/\/www.lifewire.com\/thmb\/xT-zhkZ-Y5RurLtQq2-VKuDKa3Y=\/300x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 300w, https:\/\/www.lifewire.com\/thmb\/zQH7j1WDEP3mYppSK7d2YM9slRA=\/417x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 417w, https:\/\/www.lifewire.com\/thmb\/Is5deaziVO7-Sx4AWjwLNtr6JDA=\/534x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 534w, https:\/\/www.lifewire.com\/thmb\/SbnjFfC6zj1BygsVAofArZ8lkOA=\/768x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png 768w\" data-src=\"https:\/\/www.lifewire.com\/thmb\/SbnjFfC6zj1BygsVAofArZ8lkOA=\/768x0\/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)\/pauseapps-56a5aaaf5f9b58b7d0dde4bc.png\" data-expand=\"300\" \/><\/div>\n<p>&nbsp;<\/p>\n<\/div><figcaption class=\"figure-article-caption\">\u00a0Pause Terminal Applications.<\/figcaption><\/figure>\n<ul>\n<li>CTRL + Z &#8211; Pauses an application<\/li>\n<li>fg &#8211; Returns you to the application<\/li>\n<\/ul>\n<p>So what is this tip about?<\/p>\n<p>Imagine you have opened a file in nano as follows:<\/p>\n<blockquote><p>sudo nano abc.txt<\/p><\/blockquote>\n<p>Halfway through typing text into the file, you realize that you quickly want to type another command into the terminal but you can&#8217;t because you opened nano in foreground mode.<\/p>\n<p>You may think your only option is to save the file, exit nano, run the command and then re-open nano.<\/p>\n<p>All you have to do is press CTRL + Z and the foreground application will pause and you will be returned to the command line. You can then run any command you like and when you have finished return to your previously paused session by entering &#8220;fg&#8221; into the terminal window and pressing return.<\/p>\n<p>An interesting thing to try out is to open a file in nano, enter some text and pause the session. Now open another file in nano, enter some text and pause the session. If you now enter &#8220;fg&#8221; you return to the second file you opened in nano. If you exit nano and enter &#8220;fg&#8221; again you return to the first file you opened within nano.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u00a0Pause Terminal Applications. CTRL + Z &#8211; Pauses an application fg &#8211; Returns you to the application So what is this tip about? Imagine you have opened a file in nano as follows: sudo nano abc.txt Halfway through typing text into the file, you realize that you quickly want to type another command into [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":2,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}