nohup – run a command immune to hangups, with output to a non-tty

A UNIX Command
$nohup ls < /dev/null
nohup: appending output to `nohup.out'
$cat nohup.out
Desktop
Downloads
JohnySagariga
LeanBiz.zip
nohup.out
$ls
Desktop  Downloads  JohnySagariga  LeanBiz.zip  nohup.out
$

$nohup top < /dev/null
nohup: appending output to `nohup.out'
$cat nohup.out
Desktop
Downloads
JohnySagariga
LeanBiz.zip
nohup.out
	top: failed tty get

$nohup top < /dev/
nohup: appending output to `nohup.out'
$who
jeffrin  tty7         2011-08-09 19:48 (:0)
jeffrin  pts/0        2011-08-09 21:18 (:0.0)
jeffrin  pts/1        2011-08-09 21:20 (:0.0)
$nohup top < /dev/pts/1
nohup: ignoring input and appending output to `nohup.out'
$cat nohup.out
Desktop
Downloads
JohnySagariga
LeanBiz.zip
nohup.out
	top: failed tty get

	top: failed tty get

	top: failed tty get

$

UNIX Explanation
Usage: nohup COMMAND [ARG]...
  or:  nohup OPTION
Run COMMAND, ignoring hangup signals.

      --help     display this help and exit
      --version  output version information and exit

If standard input is a terminal, redirect it from /dev/null.
If standard output is a terminal, append output to `nohup.out' if possible,
`$HOME/nohup.out' otherwise.
If standard error is a terminal, redirect it to standard output.
To save output to FILE, use `nohup COMMAND > FILE'.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s