리눅스 nohup 사용법

Jmnote (토론 | 기여)님의 2013년 6월 25일 (화) 16:17 판

1 개요

nohup 사용법
  • 행업을 무시하고 명령어를 실행함[1]
  • 표준출력을 nohup.out(또는 다른 곳)으로 돌림

2 기본 (nohup.out 출력)

nohup 없이 echo 실행
[root@jmnote ~]# echo hello
hello
→ 터미널 화면에 출력된다.
nohup으로 echo 실행
[root@jmnote ~]# nohup echo hello
nohup: appending output to `nohup.out'
[root@jmnote ~]# cat nohup.out
hello
→ echo 내용이 nohup.out으로 출력되었다.

3 다른 파일에 출력

[root@jmnote ~]# nohup echo hello > 1.txt
[root@jmnote ~]# cat 1.txt
hello

4 출력 안하기

/dev/null에 출력하도록 바꾸면 어디에도 출력되지 않는다.

[root@jmnote ~]# rm -f nohup.out
[root@jmnote ~]# nohup echo hello > /dev/null
[root@jmnote ~]# cat nohup.out
cat: nohup.out: No such file or directory

5 같이 보기

6 주석

  1. run a command immune to hangups, with output to a non-tty

7 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}