The nohup command can allow a long-running process to run to completion even after you log off. By default, processes run on the Linux command line are terminated as soon as you log out of your session. However, if you want to start a long-running process and ensure that it keeps running after you log off, there are a couple ways that you can make this happen. The first is to use the nohup command. Using nohup The nohup (no hangup) command will override the normal hangups (SIGHUP signals) that terminate processes when you log out. For example, if you wanted to run a process with a long-running loop and leave it to complete on its own, you could use a command like this one: % nohup long-loop & [1] 6828 $ nohup: ignoring input and appending output to 'nohup.out' Note that SIGHUP is a signal that is sent to a process when the controlling terminal of the process is closed. Once you use the nohup command in this way, you can log out knowing that it will run to completion on its own. Depending on the process, it is likely to be done the next time you log in. In any case, output that is generates will be added to a file named “nohup.out”. If you want your output to be put into a separate file (e.g., if you need to preserve some earlier nohup.out content), you can specify another output name with a command like this: $ nohup long-loop &> nohup2.out & If the process is still running when you log back in, you should be able to find it in the ps command output. You will not see it using the jobs command. $ ps -ef | grep loop shs 6861 6366 0 13:52 pts/4 00:00:00 /bin/bash ./long-loop If the process is completed before you log back in, looks for its output in the nohup.out file. Leaving a process to run on its own after it has already started You can leave a process running on its own even after it has already started running. To do this: Type Ctrl+Z to pause the program and get back to the shell Use the bg command to move the process to run in the background Use the disown -h command (i.e., disown -h %1) where %1 is the job number to disassociate it with your current shell NOTE: You can also find your job number with the jobs command. $ big-loop ^Z [1]+ Stopped big-loop $ bg [1]+ big-loop & Wrap-up Moving a lengthy process to run in the background can allow you to let it continue when you need to move onto some other task or just go home at the end of a busy day. An earlier post on keeping processes running after you log off is available at this URL: How to keep Linux from hanging up on you Related content how-to How to find files on Linux There are many options you can use to find files on Linux, including searching by file name (or partial name), age, owner, group, size, type and inode number. By Sandra Henry Stocker Jun 24, 2024 8 mins Linux opinion Linux in your car: Red Hat’s milestone collaboration with exida With contributions from Red Hat and critical collaborators, the safety and security of automotive vehicles has reached a new level of reliability. By Sandra Henry Stocker Jun 17, 2024 5 mins Linux how-to How to print from the Linux command line: double-sided, landscape and more There's a lot more to printing from the Linux command line than the lp command. Check out some of the many available options. By Sandra Henry Stocker Jun 11, 2024 6 mins Linux how-to Converting between uppercase and lowercase on the Linux command line Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. By Sandra Henry Stocker Jun 07, 2024 5 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe