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 examine files on Linux Linux provides very useful options for viewing file attributes, such as owners and permissions, as well as file content. By Sandra Henry Stocker Oct 24, 2024 6 mins Linux how-to 8 easy ways to reuse commands on Linux Typing the same command again and again can become tiresome. Here are a number of ways you can make repeating commands – or repeating commands but with some changes – a lot easier than you might expect. By Sandra Henry-Stocker Oct 15, 2024 5 mins Linux news SUSE Edge upgrade targets Kubernetes and Linux at the edge SUSE Edge 3.1 includes a new stack validation framework and an image builder tool that are aimed at improving the scalability and manageability of complex Kubernetes and Linux edge-computing deployments. By Sean Michael Kerner Oct 15, 2024 6 mins Edge Computing Linux Network Management Software how-to Lesser-known xargs command is a versatile time saver Boost your Linux command line options and simplify your work with xargs, a handy tool for a number of data manipulation tasks. By Sandra Henry Stocker Oct 11, 2024 6 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe