[맥북 / macOS] 터미널에서 시스템 재부팅 시간, 종료 시간 확인하기

간단한 터미널 커맨드 몇가지를 이용해서 시스템 시작 시간, 종료 시간, 재시작 시간을 확인할 수 있습니다. 거두절미하고 바로 설명으로 들어가도록 하겠습니다. 우선, 터미널 앱을 실행해주세요.

  • Spotlight(cmd + space) > Terminal


시스템 종료 시간 확인하기

아래 두 종류의 커맨드를 터미널창에 입력하시면 확인하실 수 있습니다.

last shutdown
last | grep shutdown

시스템 재부팅 시간 확인하기

방법 1. last reboot

last reboot 커맨드를 입력함으로써, 지나간 최근 재부팅 시간을 확인할 수 있습니다. 위에서부터 아래로 갈수록 오래된 정보입니다. wtmp는 로그인, 로그아웃, 시스템의 재부팅 등에 관한 정보가 담겨진 로그입니다.

방법 2. who -b

다음 커맨드로 가장 최근에 reboot된 시점을 확인할 수 있습니다. who 커맨드는 현재 시스템에 로그인되어 있는 유저 정보를 나타내는 커맨드로 아래와 같이 다양한 옵션이 존재합니다. 금번 주제에 맞게 -b를 이용하면 가장 최근 재부팅 시간을 확인할 수 있습니다. 본 커맨드에 관한 더 자세한 정보는 위키피디아를 참조 바랍니다.

who Options – 출처 : 위키피디아

  • -a, process the system database used for user information with the -b, -d, -l, -p, -r, -t, -T and -u.
  • -b, show time when system was last rebooted
  • -d, show zombie processes and details
  • -H, show column headers
  • -l, show terminals where a user can log in
  • -m, show information about the current terminal only
  • -p, show active processes
  • -q, quick format, show only names and the number of all users logged on, disables all other options; equivalent to users command line utility
  • -r, show runlevel of the init process.
  • -s, (default) show only name, terminal, and time details
  • -t, show when system clock was last changed
  • -T, show details of each terminal in a standard format (see note in Examples section)
  • -u, show idle time; XSI shows users logged in and displays information whether the terminal has been used recently or not

방법 3. uptime

uptime 커맨드를 이용하면 시스템 가동 시간을 알 수 있습니다. 즉, 얼마나 시스템이 가동되었는지를 현재 시간에서 차감하게 되면 마지막 부팅 시간을 추론해 낼 수 있습니다. 사실, 위 두 커맨드로 직관적으로 나오기 때문에 재부팅 시간을 알기 위해서 이 커맨드를 사용할 것 같지는 않습니다 🙂

댓글 남기기