{"id":459832,"date":"2022-06-08T20:00:15","date_gmt":"2022-06-08T17:00:15","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-use-the-nohup-command-in-linux\/"},"modified":"2022-06-08T20:00:15","modified_gmt":"2022-06-08T17:00:15","slug":"how-to-use-the-nohup-command-in-linux","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-nohup-command-in-linux\/","title":{"rendered":"#How to Use the nohup Command in Linux"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a26bff3853de\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a26bff3853de\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-nohup-command-in-linux\/#%E2%80%9CHow_to_Use_the_nohup_Command_in_Linux%E2%80%9D\" >&#8220;How to Use the nohup Command in Linux&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-nohup-command-in-linux\/#HUP_and_SIGHUP\" >HUP and SIGHUP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-nohup-command-in-linux\/#The_nohup_Command\" >The nohup Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-nohup-command-in-linux\/#Using_nohup\" >Using nohup<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CHow_to_Use_the_nohup_Command_in_Linux%E2%80%9D\"><\/span>&#8220;How to Use the nohup Command in Linux&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div>\n<figure style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage size-full wp-image-791996\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/03\/shutterstock_321627716.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Linux laptop showing a bash prompt\" width=\"1200\" height=\"675\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-vector\/linux-interface-screen-notebook-world-map-321627716\">fatmawati achmad zaenuri\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>The Linux <code>nohup<\/code> command lets important processes carry on running even when the terminal window that launched them is closed. We show you how to use this venerable command on today\u2019s Linux.<\/p>\n<h2 id=\"hup-and-sighup\"><span class=\"ez-toc-section\" id=\"HUP_and_SIGHUP\"><\/span>HUP and SIGHUP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Unix, the ancestor of Linux, was created before the PC was invented. Computers were large, expensive pieces of equipment. People interacted with them over serial lines either locally within the same building or remotely over slow modem connections. Originally, they typed their instructions on\u00a0teleprinters that were gradually replaced by dumb terminals.<\/p>\n<p>They were called dumb because the processing power was in the computer you were connected to, not the terminal you were typing on. The programs were running on the computer\u2014where ever that may have been located\u2014and not on the device on your desk.<\/p>\n<p>If something h<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ened that broke the connection between your terminal and the computer, the computer detected the line drop and sent a <code>HUP<\/code> or <em>hang up<\/em> signal to the programs you\u2019d been running. The programs ceased execution when they received the signal.<\/p>\n<p>That functionality lives on in Linux today. On your PC, a terminal window is an emulation of a physical terminal. If you have processes running that were launched from that terminal window and you close that window the <code>SIGHUP<\/code> signal is sent to the programs so that they\u2019re informed of the <code>HUP<\/code> and know they should terminate.<\/p>\n<p>There\u2019s a cascade effect that takes place. If the processes have launched any child processes the SIGHUP is passed down the line to them too so that they know they ought to terminate.<\/p>\n<p>The <code>nohup<\/code> command launches child processes but refuses to pass <code>SIGHUP<\/code> signals to them. That might sound like a problem, but it\u2019s actually a useful function.<\/p>\n<h2 id=\"the-nohup-command\"><span class=\"ez-toc-section\" id=\"The_nohup_Command\"><\/span>The nohup Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you want to have a process continue even if the terminal window it was launched from is closed, you need a way to intercept the <code>SIGHUP<\/code> so that the program never receives it. (Actually, the terminal window doesn\u2019t launch processes, they\u2019re launched by the shell session inside the terminal window.) The simple and elegant solution to that problem is to place another process between the shell session and the program, and have that middle-layer program never pass on the <code>SIGHUP<\/code> signal.<\/p>\n<p>That\u2019s what <code>nohup<\/code> does. It launches programs for you so that they are a child process of <code>nohup<\/code>, not a child process of the shell. Because they\u2019re not a child process of the shell, they won\u2019t directly receive a <code>SIGHUP<\/code> from the shell. And if <code>nohup<\/code> doesn\u2019t pass on the <code>SIGHUP<\/code> to its children, the program won\u2019t receive <code>SIGHUP<\/code> at all.<\/p>\n<p>This is useful when, for example, you have a long-running process that you need to let run to completion. If you accidentally close the terminal window and its shell, you\u2019ll terminate the process too. Using <code>nohup<\/code> to launch the process isolates the process from the <code>nohup<\/code> signal. If you\u2019re working remotely on a computer over SSH and you don\u2019t want a sensitive process to terminate if the remote connection fails, you\u2019d start the process on the remote computer with <code>nohup<\/code> .<\/p>\n<h2 id=\"using-nohup\"><span class=\"ez-toc-section\" id=\"Using_nohup\"><\/span>Using nohup<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We created a program that doesn\u2019t do anything useful, but it will run and run until it is terminated. It prints the time to the terminal window every three seconds. It\u2019s called <code>long-proc<\/code> for \u201clong process.\u201d<\/p>\n<pre>.\/long-proc<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804835\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/1-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The long-proc program running a terminal window\" width=\"644\" height=\"270\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If this was a program that did something useful and we wanted it to continue to run even if the terminal window and shell are closed, we\u2019d launch it with <code>nohup<\/code>.<\/p>\n<pre>nohup .\/long-proc<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804836\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/2-3.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"launching the the long-proc program from nohup\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The process is decoupled from <code>stdin<\/code> and <code>stdout<\/code>\u00a0so it can neither receive any input nor write to the terminal window. Also, because it is still running, you\u2019re not returned to the command prompt. All that <code>nohup<\/code> does is make the process impervious to the terminal closing down. It doesn\u2019t\u00a0turn the process into a background task.<\/p>\n<p>Do you now have to reboot just to terminate the process? No. To stop a <code>nohup<\/code> process you haven\u2019t launched as a background process, hit the Ctrl+C key combination.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804837\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/3-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Halting the long-proc process with Ctrl+C\" width=\"644\" height=\"110\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The output from the program has been captured for us in a file called \u201cnohup.out.\u201d We can review it with less.<\/p>\n<pre>less nohup.out<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804838\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/4-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Opening the nohup.out file in less\" width=\"644\" height=\"55\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Anything that would usually be sent to the terminal window is captured in the file. Subsequent runs of <code>nohup<\/code> will be appended to the existing \u201cnohup.out\u201d file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804839\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/5-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The output from long-proc written to the nohup.out file, displayed in less\" width=\"644\" height=\"380\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>A more useful way to run the process is to launch it with <code>nohup<\/code> so that it withstands the terminal window being closed, and to make it a background task at the same time. To do this we add an ampersand \u201c<code>&amp;<\/code>\u201d to the end of the command line.<\/p>\n<pre>nohup .\/long-proc &amp;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804840\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/6-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"launching the long-proc program with nohup and making it a background task\" width=\"644\" height=\"160\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You\u2019ll need to hit \u201cEnter\u201d once more to return to command prompt. We\u2019re told the job number of the process is 1\u2014the number in brackets \u201c<code>[]<\/code>\u201c\u2014 and that the process ID is 13115.<\/p>\n<p>We can use either of these to terminate the process. \u201cCtrl+C\u201d won\u2019t work now because the program doesn\u2019t have any association with either the terminal window or the shell.<\/p>\n<p>If you forget what the job number is, you can use the <code>jobs<\/code> command to list the background tasks that have been launched from that terminal window.<\/p>\n<pre>jobs<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804843\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/7-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Listing the background tasks that have been launched from a terminal window\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>To kill our task we can use the <code>kill<\/code> command and the job number, preceded by a percentage sign \u201c<code>%<\/code>\u201c, like this:<\/p>\n<pre>kill %1<\/pre>\n<p>If you\u2019ve closed the terminal window you\u2019ll need to find the process ID and use that with the <code>kill<\/code> command. The <code>pgrep<\/code> command will find the process ID for processes that match the search clue you provide. We\u2019ll search for the process name.<\/p>\n<pre>pgrep long-proc<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804844\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/8-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Finding the process ID of a process by name\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Now we can use the process ID to terminate the process.<\/p>\n<pre>kill 13115<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804845\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/9-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using the kill command and process ID to terminate a process\" width=\"643\" height=\"110\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The next time you hit \u201cEnter\u201d you\u2019re informed that the process has been terminated.<\/p>\n<p>Now let\u2019s look at what\u00a0<em>doesn\u2019t<\/em>\u00a0terminate the process. We\u2019ll relaunch it, and then close the terminal window.<\/p>\n<pre>nohup .\/long-proc<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804853\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/10-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Closing the terminal window with a process running\" width=\"644\" height=\"296\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If we open a new terminal window and search for our process with <code>pgrep<\/code>, we see it is still running. Closing the terminal window that launched the process has had no effect.<\/p>\n<pre>pgrep long-proc<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804854\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/11-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using pgrep to search for a process by name\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>It is possible to pass multiple commands to <code>nohup<\/code>, but it is usually better to launch them separately. It makes it easier to manipulate them as background jobs. The\u00a0commands won\u2019t run at the same time, they\u2019ll be executed one after the other. The execution is not concurrent, it\u2019s sequential. To have them run concurrently you need to launch them separately.<\/p>\n<p>Having said that, to launch several processes at once, use <code>nohup<\/code> to launch a Bash shell and use the <code>-c<\/code> (commands) option with the string of commands. Use single quote marks \u201c<code>'<\/code>\u201d to wrap the command list and double ampersands \u201c<code>&amp;&amp;<\/code>\u201d to separate the commands.<\/p>\n<pre>nohup bash -c 'ls \/bin &amp;&amp; ls \/sbin'<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804857\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/12-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Launching two process with nohup\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you use <code>less<\/code> to look through the \u201cnohup.out\u201d file, you\u2019ll see the output from the first process, then the output from the second process.<\/p>\n<pre>less nohup.out<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804858\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/13-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Opening the nohup.out file in less\" width=\"644\" height=\"55\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The output from both commands has been captured in the \u201cnohup.out\u201d file. It is not intertwined, the output from the second process only starts once the first process has terminated.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804859\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/14-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The contents of the nohup.out file in less\" width=\"644\" height=\"380\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you want to use a file of your own instead of \u201cnohup.out\u201d, you can redirect the command into the file of your choice.<\/p>\n<pre>nohup bash -c 'ls \/bin &amp;&amp; ls \/sbin' &gt; myfile.txt<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804861\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/15-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"redirecting the output from the processes to a user-provided file\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Note that the message no longer says \u201cappending output to nohupo.out\u201d, it says \u201credirecting stderr to stdout\u201d and we\u2019re redirecting stdout to our \u201cmyfile.txt\u201d file.<\/p>\n<p>We can look inside \u201cmyfile.txt\u201d file with less.<\/p>\n<pre>less myfile.txt<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804862\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/16-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"644\" height=\"55\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>As before, it contains the output from both commands.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804865\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/17.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"644\" height=\"380\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<hr\/>\n<p>It\u2019s funny how the history of a utility can sometimes make it seem as though it had no relevance to modern times. The <code>nohup<\/code> command is one of those. Something that was created to cope with disconnects on serial lines is still useful to today\u2019s Linux users on incredibly powerful machines.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>37 Important Linux Commands You Should Know<\/em><\/strong><\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/804823\/nohup-command-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;How to Use the nohup Command in Linux&#8221; fatmawati achmad zaenuri\/Shutterstock.com The Linux nohup command lets important processes carry on running even when the terminal window that launched them is closed. We show you how to use this venerable command on today\u2019s Linux. HUP and SIGHUP Unix, the ancestor of Linux, was created before the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":459833,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/03\/shutterstock_321627716.png?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-459832","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/459832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=459832"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/459832\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/459833"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=459832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=459832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=459832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}