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

$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

$

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

Your email address will not be published. Required fields are marked *