개발/shell
[shell] > 와 & 에 대한 고찰
방푸린
2022. 1. 11. 14:00
반응형
JAVA $JAVA_OPTS -jar $HOME/was/*.jar 1> $HOME/logs/server.log 2>&1 &
위 스크립트에서 &가 없으면 실행시킨 화면에서 실행이되고, 그 곳을 빠져나가면 shutdown 된다.
배포 쉘에 항상 저렇게 쓰는데, 매번 까먹어서 정리
- & : executes the first command in the background, The shell does not wait for the command to finish, and the return status is 0.
- && : executes the first command and conditionally proceeds to the second if it exits with success
- nohup : A background process(&) will not stay alive after the shell session is closed. Nohup makes running after you disconnect from the session. sh file should has 755 permission. nohup file will be created with debig info.
- > : redirection
참고
https://joonyon.tistory.com/98
쉽게 설명한 nohup 과 &(백그라운드) 명령어 사용법
안녕하세요. 린아저씨 입니다. 리눅스를 사용하다 보면 프로그램을 백그라운드에서 세션과의 연결이 끊어져도 돌려야할 일이 많이 발생합니다. 그럴때 주로 사용하는 명령어가 바로 nohup 과 &
joonyon.tistory.com
728x90
반응형