Want to have a process continue run, even after you log out of the current shell you're logged into? The nohup utility will allow you to do just that!
The nohup command tells the current shell to run a command, and do so by detaching the command's process from the current/active shell. What this does
is to make the process run independently - when the current/active shell is exited,
the process will continue to run, just as if it were a system service.
The very simply syntax is as follows: $ nohup <command> &
- command refers to the process that will be running even after logging off
- Of course you know what the ampersand (&) does
The nohup command works by ignoring the SIGHUP (signal hang up), which is normally sent to a process when its controlling terminal is closed. By ignoring this signal, the process does not stop when the user logs out - allowing the process to
continue running in the background.
@Trevor if you are married you can tell for sure when the wife calls, it is basically wrapped up with nohup so that even if the call disconnects, you keep on executing the orders in the background !!!!!!
Anyways adding onto this, 5 things to keep in mind :
1. You need to install coreutils to use this command.
2. When a process is launched using nohup, it operates independently of the shell that initiated it. This means it explicitly disconnects from the standard input (stdin) of the original shell, and instead of inheriting the shell's standard output (stdout) and standard error (stderr), it redirects both of these streams to a file named nohup.out
nohup: ignoring input and appending output to 'nohup.out'
3. nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an ‘&’ .
4. nohup does not alter the niceness of command.
5. Another utility disown can do the same thing with processes that you forgot to run with nohup.
Chetan_Tiwary_, I do the framing, and you do the finishing - which is the most important part in the construction of any facility!!!
As always, thank you for the great addition - that is, the fantastic finishing job!!!!
Nice..! Thanks for sharing..!
Thanks for sharing..!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.