[email protected]Office hours: Mon – Fri 9:00AM – 5:00PMLinkedInXFacebook
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 Implement Network Segmentation and Resource Isolation in Linux.
February 6, 2024

How to Implement Network Segmentation and Resource Isolation in Linux.

How to Implement Network Segmentation and Resource Isolation in Linux. Securing and managing networks in a Linux environment involves advanced practices like network segmentation and resource isolation. This guide explores these concepts, providing detailed instructions and examples for…

Read article
How to open or close ports in Linux.
February 6, 2024

How to open or close ports in Linux.

How to open or close ports in Linux. Effectively managing ports on your Linux system is crucial for both security and service accessibility. This comprehensive guide will provide a detailed walkthrough on opening and closing ports using the robust tools iptables and ufw. Understanding these…

Read article
How to use ypdomainname command.
January 23, 2024

How to use ypdomainname command.

How to use ypdomainname command. In the realm of Linux networking, the ypdomainname command plays a crucial role in the context of the Network Information Service (NIS). NIS, formerly known as Yellow Pages, is a distributed database service that facilitates the sharing of network configuration 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, colocation, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Office hours: Mon – Fri 9:00AM – 5:00PM