• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Use Shutdown Command in Linux

Written by Admin, Updated On December 10, 2022
linux commands, shutdown, terminal
Shutdown Command in Linux

Shutdown command is used to bring the system down in a safe and secure way. When the shutdown process is initiated, all the logged in users are notified that the system is going down right now or after some time. Using this command you can set specific time to make down your system.

Shutdown Command Syntax#

Before going to ahead to learn how to use shutdown command, you should know the basic syntax.

Below is the basic syntax for the shutdown utility:

shutdown [OPTIONS] [TIME] [MESSAGE]

Here,

  • options – You can use Shutdown options like halt, power off or reboot the system.
  • time – It specifies that when shutdown process should perform.
  • message – Set the message which you want to show to all users before start shutdown process.

How to use Shutdown Command#

If you will issue shutdown command without any option then it will considered default(power off) option and power off the machine.

sudo shutdown

Once you will execute above command system will shutdown within 1 minute which is default time interval. You will see output as below:

Shutdown scheduled for Wed 2019-05-02 17:24:27 EDT, use 'shutdown -c' to cancel.

Shutdown System Immediately#

By default, shutdown interval time is 1 minute but you can skip that delay and shutdown immediately using now as time argument. To do so use below command:

sudo shutdown now

It will immediately shutdown your system without any message or notification.

How to Shutdown System At Specified Time#

Time argument is used to shutdown system at specific time. You can specify time argument in two different format: hh:mm for relative and +m for number of minutes. By using these formats you can schedule a shutdown at specific time.

Below command will schedule shutdown at 04:00 AM :

sudo shutdown 04:00

Following will schedule shutdown after 15 minutes from now:

sudo shutdown +15

Broadcast a Custom Message#

Using message argument you can broadcast a custom message to all the users when performing the shutdown process. It important to specify time argument when broadcasting a message.

In below example, system shutdown in 15 minutes from now and notify users that maintenance will perform.

sudo shutdown +15 "Maintenance"

Cancel the Shutdown#

If you have already scheduled shutdown and want to cancel then you can do it using the -c argument. It will cancel shutdown process immediately.

Run the below command to cancel scheduled shutdown:

sudo shutdown -c

At the time of cancellation you can not specify time argument but you can broadcast a custom message. Execute below command:

sudo shutdown -c "Canceled shutdown"

How to Reboot System#

Using -r argument you can reboot the system. Run the below command:

sudo shutdown -r

Also, you can specify time and custom message as below:

shutdown -r +5 "Update System"

Conclusion#

Finally, you have learned use of shutdown command in Linux with different arguments. Learn more by visit the shutdown man page.

If you have any questions, you can leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article Wget Command Examples on Linux Command Line
Next Article   Remove Files and Directories Using Linux Command Line

Related Posts

  • How to Install SSH Keys on Ubuntu 22.04

    How to Set up SSH Keys on Ubuntu 22.04

    January 7, 2023
  • How to Install Fail2ban on Ubuntu 22.04

    How to Install and Configure Fail2ban on Ubuntu 22.04

    December 5, 2022
  • How to Enable SSH on Ubuntu 22.04

    How to Enable SSH on Ubuntu 22.04

    December 1, 2022

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook