Shutting Down and Rebooting the Ubuntu System

Shutting Down the system

Use the shutdown command to shut down your system. The shutdown command has a number of different command-line options (such as shutting down at a predetermined time), but the fastest way to cleanly shut down Linux is to use the -h (or halt) option, followed by the word now:

You can also follow -h with the numeral zero (0), like this, to get the same effect:

To incorporate a timed shutdown and a pertinent message to all active users, use shutdown‘s time and message options, as follows:

This example shuts down you system and provide a warning to all active users 30 minutes before the shutdown (or reboot).

Shutting down a running server can be considered drastic, especially if there are active users or exchanges of important data occurring (such as a backup in progress). One good approach is to warn users ahead of time. This can be done by editing the system Message of the Day (MOTD) motd file, which displays a message to users when they log in using the command-line interface, as is common on multiuser systems.

You can also make downtimes part of a regular schedule, perhaps to coincide with security audits, software updates, or hardware maintenance.

Rebooting the System

You should use the shutdown command to reboot your system. The fastest way to cleanly reboot Linux is to user the -r option and the word now:

You can also follow -h with the numeral zero (0), like this, to get the same effect:

Both rebooting and shutting down can have dire consequences if performed at the wrong time (such as during backups or critical file transfer, which arouses the ire of your system’s users).

However, Linux-based operating systems are designed to properly stop active system services in an orderly fashion.

Others commands you can use to shut down and reboot Linux are the halt, poweroff, and reboot commands, but the shutdown command is more flexible.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s