System and processes

The shutdown command

Shuts down or restarts the machine in an orderly way, warning users and closing programs.

Syntax

sudo shutdown [-h|-r] now | shutdown -c

Most useful options

-hPower off
-rRestart
-cCancel a scheduled shutdown
+NSchedule in N minutes

Copy-ready examples

$ sudo shutdown -h nowPower off now
$ sudo shutdown -r nowRestart now

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • It requires administrator rights.
  • On a remote server, powering off without warning can cut your own connection.

Related commands

FAQ

How do I cancel a shutdown?

With shutdown -c before the time arrives.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course