Enhancing Skills

shutdown: Shutdown the system

Command: shutdown

The shutdown command is used to power off or halt the system in an orderly manner. It ensures that all processes are terminated, filesystems are unmounted, and the system is safely powered down. It requires superuser privileges to execute.


Sample Commands and Outputs:

  • shutdown now: Shuts down the system immediately. Sample Command and Output:
  $ sudo shutdown now

Description:

  • now: Instructs the system to shut down immediately.
  • The system will begin the shutdown sequence right away, terminating all processes and powering off the machine.
  • shutdown -h +10: Schedules a shutdown in 10 minutes. Sample Command and Output:
  $ sudo shutdown -h +10
  Shutdown scheduled for Fri 2024-08-09 12:34:56 UTC (in 10 minutes)

Description:

  • -h +10: The option to halt the system in 10 minutes.
  • This command schedules a shutdown 10 minutes from the current time, giving users a warning period to save their work.
  • shutdown -r 22:00: Schedules a system reboot at 10:00 PM. Sample Command and Output:
  $ sudo shutdown -r 22:00
  Shutdown scheduled for Fri 2024-08-09 22:00:00 UTC, Reboot initiated.

Description:

  • -r 22:00: The option to reboot the system at 10:00 PM.
  • This command schedules the system to shut down and then restart at the specified time.
  • shutdown -c: Cancels a scheduled shutdown or reboot. Sample Command and Output:
  $ sudo shutdown -c
  Shutdown canceled.

Description:

  • -c: The option to cancel any pending shutdown or reboot command.
  • This command is useful if you need to abort a scheduled shutdown.

Note: The shutdown command is vital for system maintenance, allowing for controlled power-downs and reboots. In multi-user environments, it’s crucial to notify users before shutting down the system to prevent data loss or interruptions in service.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.