Learn GNU/Linux Commands (13): Turnoff - shutdown, poweroff, reboot

All Unix-like systems have the commands to turn off the computer. Although the commands such as "shutdown" exist in many such systems, the actual behavior of these commands may be different. We are talking about the GNU/Linux system below.

Shutdown the Machine

shutdown [TIME]

Shutdown the machine at TIME. the TIME string can be in the formats below:

  • hour:minutes - shutdown at the next given time in 24h clock format. For example, if now is 19:45, "shutdown 12:1" shutdown the machine at 12:01 or 0:01 PM of the next day.
  • +M - shutdown after M minutes from now. For example, "shutdown +5" shutdown the machine after 5 minutes.
  • now - alias for "+0"
  • - If no time argument is specified, "+1" is implied.


Reboot the Machine

shutdown -r [TIME]

Reboot the machine at TIME.


"shutdown" vs "poweroff" and "reboot"

In modern GNU/Linux systems with systemd, "shutdown" with no option or with the option "p" does the same thing as the command "poweroff", which tries to power off the machine after terminating other processes. "shutdown" with the option "r" does the same thing as the command "reboot", which tries to reboot the machine after terminating other processes. The advantage of using "shutdown" is the ability to schedule the action.

In other versions of Unix-like systems, the commands "poweroff" and "reboot" may not be that graceful, meaning that they may not try to terminating other processes first.



Related

Comments

Popular

Intel 7th and 8th generation processor graphics driver for Windows 7/8/8.1

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part II - Fidelity

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part IV - Decode

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part I - Lossless

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part III - Quality

OBS Studio settings for best quality (loseless) recording

Install VMAF on Fedora, CentOS/Red Hat (RHEL)