Starting a Process Using Nohup
To start a process using Nohup, simply prepend the desired command with nohup
. For example, if you want to execute a bash script named geekfile.py
using Nohup, you would use the following command:
nohup bash geekfile.sh
Output:
To redirect the output to the output.txt file:
nohup bash geekfile.sh > output.txt
Output:
nohup Command in Linux with Examples
Every command in Linux starts a process at the time of its execution, which automatically gets terminated upon exiting the terminal. Suppose, you are executing programs over SSH and if the connection drops, the session will be terminated, all the executed processes will stop, and you may face a huge accidental crisis. In such cases, running commands in the background can be very helpful to the user and this is where nohup command comes into the picture. nohup (No Hang Up) is a command in Linux systems that runs the process even after logging out from the shell/terminal.
Contact Us