fbpx Linux Shutdown Command: Power Off and Restart with Time | Certificação Linux

Linux Shutdown Command: Power Off, Restart, and Schedule Maintenance

📅 03/06/2019 ⏱ 2 min ✍️ Uira Ribeiro
Linuxcommands
Linux Shutdown Command: Power Off, Restart, and Schedule Maintenance
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

Learn how to properly shut down your Linux and disable ctrl-alt-del

The shutdown command is used to shut down or restart the system at specified times. During this procedure, it disables the login system to prevent new users from logging in and sends custom messages to the terminals of all connected users notifying that the system will be shut down.

The most frequently used options are:

  • -r  Reboots the system after the shutdown sequence is complete;
  • -h  Halts the system after the shutdown sequence is complete. Does not restart the machine;
  • -k  Sends the shutdown message but does not initiate the shutdown sequence;
  • -f   Performs a fast system boot without disk check;
  • -F  Forces a disk check when the system restarts.

To restart the system immediately:

# shutdown –r now

To restart the system at 06:00 AM and send a message to the terminals of users:

# shutdown –r 06:00 “Haverá troca de hardware”

The difference between changing the runlevel to 0 or 6 and the shutdown command is that the shutdown command is administratively better because it notifies users that there will be a system shutdown. When changing init, there is no type of warning.

Control-Alt-Delete

The "ca" line in the /etc/inittab file handles what happens when we press the control+alt+del key sequence:

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

And before taking any maintenance or restart action on the system, especially when dealing with a multi-user server, it is polite for the administrator to use the wall utility to send messages to logged-in users.

Watch this short lesson about shutdown:

Learn much more about Linux in our online course. You can enroll here with a 7-day free trial. If you already have an account, you can access it here.

Liked it? Share :-)

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp