Shutdown command to safely shut down the system. It is dangerous for some users to turn Linux off using a direct power-off. Because Linux, unlike Windows, runs many processes in the background, forcing a shutdown can cause data loss to the process, leave the system in an unstable state, or even damage the hardware device in some systems. You can use the man shutdown to learn more about commands.
SHUTDOWN (8) Shutdown shutdown (8) NAME shutdown-Halt, power-off or reboot the machinesynopsis shutdown [OPTIONS ...] [TIME] [WALL ...] DESCRIPTION shutdown May is used to halt, power-off or reboot the machine. The first argument may be a timestring(which isUsually" Now"). Optionally, ThisMay is followed by a wall message to being sent to all logged-inchusers before going down. the timestringMay either isinchThe format"hh:mm" forhour/minutes specifying the time to execute the shutdown at, specifiedinch24h clock format. Alternatively it mayinchThe syntax"+m"Referring to the specified number of minutes m fromNow." Now" isAn alias for "+0", i.e. fortriggering an immediate shutdown. If no time argument isSpecified"+1" isimplied. Note that to specify a wall message you must specify a time argument, too. If the time argument isUsed,5Minutes before the system goes down The/run/nologin file iscreated to ensure this further logins shall not be allowed. Options The following options are understood:--Help Print a ShortHelp text and exit. -H,--Halt halt the machine. -P,--Poweroff Power-off the Machine (thedefault). -R,--reboot reboot the machine. -h equivalent to--poweroff, unless--halt isspecified. -k do not halt, power-off, reboot, just write wall message. --no-wall do not send wall message before halt, power-off, reboot. -c Cancel a pending shutdown. This is used cancel the effect of an invocation of shutdown with a time argument that isNot"+0"Or" Now". EXIT STATUS on success,0 isReturned, a non-Zero Failure code otherwise. See ALSO Systemd (1), Systemctl (1), Halt (8), Wall (1) Systemd229SHUTDOWN (8)
From the man page you know: Shutdown is used to pause, shut down, and restart the machine. Shutdown is followed by 3 parameters, all of which have [], and the description is an optional parameter. It is understood in description that if the time parameter is not specified, it means that the default configuration is "+1", in minutes. If the time parameter is now, it means that the period is configured as "+0" in minutes. The time can also be set to "hh:mm" = hour/minutes to operate.
Command parameter Description:
--Help: -h/--half: Turn off machine -p/--poweroff: Turn off machine -r/--reboot: Restart machine -H: with-- Poweroff -K: Do not pause, do not shut down, do not restart the machine, only send messages to the online user --no-wall: Before pausing, shutting down, restarting the machine, not sending the message to the online user - C: Cancel the shutdown command operation
Instance:
Perform shutdown commands at specific times
Shutdown–h now // shut down immediately :xx // shut down at 12:00
Specify to shut down after five minutes and issue a warning message
Shutdown +5"This System would be shutdowninch 5minutes "broadcast message from[Email protected]8(/dev/pts/0) at -: -..... The System isGoing down forMaintenanceinch 5minutes!//System RemindersThis System would be shutdowninch 5Minutes//User-definable reminders
Specify restart after 3 minutes and issue a warning message
Shutdown–r +3 from [email protected]8(/dev/pts/0: - is for in3 minutes! // System reminder 3 minutes after shutdown restart // user-defined reminders
Send reminders to all logged-in users without shutting down reboots.
5 from [email protected]8(/dev/pts/0: is for in5 minutes! Waring:maybe The system would be shutdown
The shutdown of Linux commands