logout, shutdown, reboot, poweroff

정리·2022년 2월 27일
0

Linux - User & Group

목록 보기
1/1

shutdown [OPTIONS] [TIME] [MESSAGE]

  • OPTIONS
    • -P : Poweroff (default)
    • -r : Reboot
    • -h : Equivalent to --poweroff
    • -c : Cancel a pending shutdown
    • -t
  • TIME
    • now : 즉시종료
    • +3 : 3분뒤 종료
    • hh:mm : hh시 mm분 종료
$ sudo shutdown -h now # 즉시 종료
$ sudo shutdown -P +10 # 10분 뒤 종료
$ sudo shutdown -r 10:00 # 10시에 리부트
$ sudo shutdown -c # shutdown 예약 취소
$ sudo shutdown -k +10 # 10분 뒤 종료 메시지 
$ sudo shutdown -h +10
Shutdown scheduled for Tue 2022-02-15 15:14:22 KST, use 'shutdown -c' to cancel.

reboot

  • -f : 강제 재부팅
$ sudo reboot # 리부팅

poweroff

$ sudo poweroff # 종료

init [RUN LEVEL]

  • Run Level 변경
  • /lib/systemd/system/runlevel0.target 로 링크
  • 0 : 종료
  • 1 : 단일사용자 모드, 시스템 복구 모드
  • 3 : 다중 사용자 텍스트 모드(CLI)
  • 5 : 다중사용자 그래픽 모드(GUI)
  • 6 : 리부팅

부팅시 RUN LEVEL 변경

  • /lib/systemd/system/default.target
$ sudo init 6 # 리부트
$ sudo init 0 # 종료
$ ls -l default.target  
lrwxrwxrwx 1 root root 16  910 03:47 default.target -> graphical.target
$ ln -sf multi-user.target default.target # 심볼링 링크 변경

logout, exit

  • 터미널 세션 종료
  • 접속 종료
  • 현재 사용자만 접속 종료
$ exit
$ logout

halt

  • -p
  • -f : 강제 종료
profile
내용 정리

0개의 댓글