이 명령어는 서버를 종료하는 명령어입니다.
이 명령어가 실행이 되면 먼저 /var/log/wtmp에 정보를 기록합니다.
사용형식
/sbin/halt [-n] [-w] [-d] [-f] [-i] [-p] [-h]
/sbin/reboot [-n] [-w] [-d] [-f] [-i]
/sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]
사용예 #1
간단히 halt라고하면 시스템을 종료합니다.
[root@host3 root]# halt
Broadcast message from root (pts/0) (Sat Oct 4 14:12:03 2003):
The system is going down for system halt NOW!
[root@host3 root]#
사용예 #2
-n옵션을 사용하면 sync작업을 하지않은채로 시스템을 종료합니다.
[root@host3 root]# reboot -n
Broadcast message from root (pts/0) (Sat Oct 4 14:15:17 2003):
The system is going down for reboot NOW!
[root@host3 root]#
사용예 #3
-w옵션을 사용하면 wtmp에 기록만을 남기며 시스템은 종료하지 않습니다.
[root@host3 root]# halt -w
[root@host3 root]#
사용예 #4
만약 다음과같이 -d옵션을 사용하시면 /var/log/wtmp에 기록을 남기지 않은채로 시스템을 종료합니다.
[root@host3 root]# halt -d
Broadcast message from root (pts/0) (Sat Oct 4 14:20:08 2003):
The system is going down for system halt NOW!
[root@host3 root]#
'UNIX > Linux' 카테고리의 다른 글
[Linux] last (0) | 2012.06.12 |
---|---|
[Linux] passwd (0) | 2012.06.12 |
[Linux] reboot (0) | 2012.06.12 |
[Linux] shutdown (0) | 2012.06.12 |
[Linux] locate, slocate(특정패턴의 파일을 찾는다) (0) | 2012.06.12 |
reboot reboot명령어는 시스템을 종료한 후에 재부팅을 하는 명령어입니다. 이 명령어는 halt와 poweroff와 마찬가지로 시스템을 종료하는 명령어이지만 halt와 poweroff는 시스템종료 후에 시스템의 재부팅을 하지 않지만 reboot은 시스템종료 후에 재부팅을 한다는 점에서 차이점이 있습니다. 일반적으로 halt와 poweroff는 시스템종료명령어라고 하며 reboot은 시스템 재부팅명령어라고 할 수 있습니다. 이 명령어는 init과 shutdown과 함께 알아두시기 바랍니다. 사용형식 /sbin/reboot [-n] [-w] [-d] [-f] [-i] 사용예 #1 그냥 reboot이라고 하면 시스템종료후에 재부팅을 합니다. [root@host3 root]# reboot Broadcast message from root (pts/0) (Sat Oct 4 14:36:30 2003): The system is going down for reboot NOW! [root@host3 root]# 사용예 #2 -n옵션을 사용하면 rync작업을 하지않은채로 시스템종료를 하고 재부팅을 합니다. [root@host3 root]# reboot -n Broadcast message from root (pts/0) (Sat Oct 4 14:38:50 2003): The system is going down for reboot NOW! [root@host3 root]# 사용예 #3 -w는 시스템재부팅은 하지않지만 /var/log/wtmp에 정보를 저장합니다. [root@host3 root]# reboot -w [root@host3 root]# |
'UNIX > Linux' 카테고리의 다른 글
[Linux] passwd (0) | 2012.06.12 |
---|---|
[Linux] halt (0) | 2012.06.12 |
[Linux] shutdown (0) | 2012.06.12 |
[Linux] locate, slocate(특정패턴의 파일을 찾는다) (0) | 2012.06.12 |
[Linux] hostname (0) | 2012.06.12 |
shutdown
다양한 방법으로 시스템을 종료하거나 재부팅하는 명령어입니다.
즉, shutdown명령이 수행되면 새로운 login처리가 불가능하게되고 현재 로그인해 있는 사용자들에게 시스템이 종료한다는 메시지를 보내게 됩니다.
그리고 현재 수행중인 프로세스들을 모두 종료하며 sync를 수행하여 아직 저장되지않은 데이터를 디스크에 저장한 후에 모든 파일시스템을 mount시킨후에 시스템을 종료합니다.
아래 사용예에서 다양한 사용방법을 확인하시기 바랍니다.
사용형식
/sbin/shutdown [-t sec] [-arkhncfF] time [warning-message]
사용예 #1
shutdown명령어의 -h옵션은 시스템을 halt하라는 의미의 옵션입니다.
다음과 같이 "showdown -h now"라고 하면 위에서 설명드린 시스템종료절차에 의해 시스템이 곧바로 종료됩니다. 가장 일반적인 종료명령어이며 서버관리자분들이 가장 많이 사용하는 종료명령어입니다.
[root@host3 root]# shutdown -h now
Broadcast message from root (pts/0) (Sun Oct 5 20:46:06 2003):
The system is going down for system halt NOW!
[root@host3 root]#
사용예 #2
다음은 "system is going down"이라는 메시지를 뿌려주면서 3분후에 시스템이 종료되는 예를 보인 것입니다.
종료시간을 지정하여 shutdown명령을 사용하면 다음과 같이 종료몇분 전부터 시스템이 종료된다는 메시지를 시스템에 접속한 사용자들에게 보여줍니다.
아래의 예에서 종료 몇분 전부터 로그인한 사용자들에게 시스템이 종료된다는 메시지를 뿌려주고 지정된 3분후에 시스템을 종료합니다.
[root@host3 root]# shutdown +3 "system is going down"
Broadcast message from root (pts/1) (Sun Oct 5 20:57:44 2003):
system is going down
The system is going DOWN to maintenance mode in 3 minutes!
Broadcast message from root (pts/1) (Sun Oct 5 20:58:44 2003):
system is going down
The system is going DOWN to maintenance mode in 2 minutes!
Broadcast message from root (pts/1) (Sun Oct 5 20:59:44 2003):
system is going down
The system is going DOWN to maintenance mode in 1 minute!
Broadcast message from root (pts/1) (Sun Oct 5 21:00:44 2003):
system is going down
The system is going down to maintenance mode NOW!
사용예 #3
다음은 시스템종료후에 재부팅까지 하는 예입니다.
-r 옵션은 시스템을 재부팅하라는 옵션입니다.
즉, "shutdown -r now"라는 명령에 의해 시스템의 종료후에 재부팅하게 됩니다.
그리고 이것은 reboot명령어와 동일한 명령어입니다.
시스템설정을 변경하거나 시스템의 쓰레기값들을 청소하기위하여 시스템을 재부팅하기 위하여 사용하는 명령어입니다.
[root@host3 root]# shutdown -r now
[root@host3 root]#
Broadcast message from root (pts/0) (Sun Oct 5 21:09:40 2003):
The system is going down for reboot NOW!
사용예 #4
만약 실행된 shutdown명령어를 취소하려면 -c옵션을 사용하시기 바랍니다.
-c옵션을 사용하면 이미 실행명령이 내려진 shutdown명령어를 취소하게되며 시스템종료명령이 취소됩니다.
[root@host3 root]# shutdown -c
'UNIX > Linux' 카테고리의 다른 글
[Linux] halt (0) | 2012.06.12 |
---|---|
[Linux] reboot (0) | 2012.06.12 |
[Linux] locate, slocate(특정패턴의 파일을 찾는다) (0) | 2012.06.12 |
[Linux] hostname (0) | 2012.06.12 |
[Linux] Vfat 한글 파일명 보기 (0) | 2012.06.12 |