0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

nohup(no hangup)

Posted at
sample.sh
[linuxstudy@xxxx ~]$ cat sample.sh
#!/bin/sh
    while true; do
	    sleep 3s
	    echo "i'm looping"
    done
linuxstudy@xxxx ~]$ nohup ./sample.sh &  //nohupでシェルを起動
[1] 23484
nohup: 入力を無視し、出力を `nohup.out' に追記します
[linuxstudy@xxxx ~]$ less nohup.out
[linuxstudy@xxxx ~]$ jobs
[1]+  実行中               nohup ./sample.sh &
[linuxstudy@xxxx ~]$ fg %1
nohup ./sample.sh
^C
[linuxstudy@xxxx ~]$ jobs
[linuxstudy@xxxx ~]$ cat nohup.out     //標準出力ではなくnohup.outに出力されている
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
i'm looping
NOHUP(1)                                           User Commands                                          NOHUP(1)



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

SYNOPSIS
       nohup COMMAND [ARG]...
       nohup OPTION

DESCRIPTION
       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 out‐
       put 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'.

       NOTE:  your  shell  may have its own version of nohup, which usually supersedes the version described here.
       Please refer to your shell's documentation for details about the options it supports.

       GNU coreutils online  help:  <http://www.gnu.org/software/coreutils/>  Report  nohup  translation  bugs  to
       <http://translationproject.org/team/>

AUTHOR
       Written by Jim Meyering.

COPYRIGHT
       Copyright   ©   2013  Free  Software  Foundation,  Inc.   License  GPLv3+:  GNU  GPL  version  3  or  later
       <http://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is NO  WARRANTY,  to  the  extent
       permitted by law.

SEE ALSO
       The  full  documentation  for  nohup is maintained as a Texinfo manual.  If the info and nohup programs are
       properly installed at your site, the command

              info coreutils 'nohup invocation'

       should give you access to the complete manual.



GNU coreutils 8.22                                 November 2020                                          NOHUP(1)```
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?