Sobes.tech
Middle

What is the difference between the shutdown and poweroff commands in Linux?

sobes.tech AI

Answer from AI

In Linux, the commands shutdown and poweroff are both used to turn off the system, but they have some differences:

  • shutdown is a more versatile command that allows scheduling a shutdown, reboot, or switching to another runlevel. It notifies all users and processes about the impending shutdown.

    Example: shutdown -h now — immediate shutdown.

  • poweroff is a command that directly cuts the power to the machine. It usually calls shutdown with parameters to terminate the system and turn off the power.

In modern systems, poweroff often is a synonym for shutdown -h now or invokes systemd to power off.

Summary:

  • Use shutdown for scheduling and notifications.
  • poweroff is a quick way to turn off power without additional options.