[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedSeptember 11, 2023

How to use shutdown command in Linux.

How To Use Shutdown Command.

In this tutorial, we will show you how to use the shutdown command through practical examples and detailed explanations of the most common shutdown options.

 

Shutdown Command Syntax

Before going into how to use the shutdown command, let’s start by reviewing the basic syntax.

The shutdown command expressions take the following form:

shutdown [OPTIONS] [TIME] [MESSAGE]
  • options – Shutdown options such as halt, power-off (the default option) or reboot the system.

  • time – The time argument specifies when to perform the shutdown process.

  • message – The message argument specifies a message which will be broadcast to all users.

On the recent Linux distributions shutdown is an alias to systemctl and it is available in the system only for compatibility reasons.
How to Use the shutdown Command

Only the root and users with sudo privileges can use crontab command.

When used with no arguments, the shutdown command will power off the machine.

sudo shutdown

The shutdown process starts after 1 minute, which is the default time interval.

 

How to Shutdown the System at a Specified Time

The time argument can have two different formats. It can be an absolute time in the format hh:mm and relative time in the format +m where m is the number of minutes from now.

The following example will schedule system shutdown at 11 A.M:

sudo shutdown 11:00

The following example will schedule system shutdown in 10 minutes from now:

sudo shutdown +10

 

How to Shutdown the System Immediately

To shut down your system immediately you can use +0 or its alias now:

sudo shutdown now

 

How to Broadcast a Custom Message

To broadcast a custom message along with the standard shutdown notification type your message after the time argument.

The following example, will shut down the system in 30 minutes from now and notify the users that a hardware upgrade will be performed:

sudo shutdown +30 "Hardware upgrade"

It is important to mention that when specifying a custom wall message, you must specify a time argument too.

 

How to Reboot the System

To reboot the system, use the -r argument:

sudo shutdown -r

You can also specify a time argument and a custom message:

shutdown -r +5 "Updating kernel"

The command above will reboot the system after 5 minutes and broadcast Updating kernel.

 

How to Cancel a Scheduled Shutdown

If you have scheduled shutdown and you want to cancel it, you can use the -c argument:

sudo shutdown -c

When canceling a scheduled shutdown, you cannot specify a time argument, but you can still broadcast a message that will be sent to all users.

sudo shutdown -c "Canceling the reboot"

 

Conclusion

The shutdown command allows you to halt, power-off and reboot your Linux system.

Keep reading
How to understand network IP (internet protocol)
March 6, 2023

How to understand network IP (internet protocol)

WHAT IS AN IP NETWORK? An IP network is a group of computers connected via their unique internet protocol (IP) addresses. IP is fundamental to allowing our devices to communicate with each other. It is the IP address that acts as the identifier and differentiates each individual device connected…

Read article
How to use uname command.
March 6, 2023

How to use uname command.

How To Use Uname Command. In this article, we will cover the uname command. uname is a command-line utility that prints basic information about the operating system name and system hardware. uname Command The uname tool is most commonly used to determine the processor architecture, the system…

Read article
How to use nano text editor.
March 6, 2023

How to use nano text editor.

How To Use Nano Text Editor. In this guide, explain the basic usage of the nano editor, including how to create and open a file, edit a file, save a file, search and replace text, cut and paste text, and more. GNU nano is an easy to use command line text editor for Unix and…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00