Before You Begin
Ensure that your role has the appropriate rights profiles to perform this procedure. See Using Rights Profiles to Administer Boot Features.
$ who holly console May 7 07:30 kryten pts/0 May 7 07:35 (starlite) lister pts/1 May 7 07:40 (bluemidget)
The command displays users, their corresponding terminal lines, log in dates and times, and hostnames, if users are remotely logged in.
$ shutdown -iinit-state -ggrace-period -y
Specifies the system's state as a result of the shutdown. The choices are 0, 1, S or s, 5, and 6.
Run levels 0 and 5 are reserved for shutting the system down. Run level 6 reboots the system. Run level 2 is available as a multiuser operating state.
Indicates a time in seconds before the system is shut down. The default period is 60 seconds.
Shuts down the system without further prompts after the grace period is reached. If you use this option, then skip to Step 4.
For more information, see the shutdown(8) man page.
$ init [options]
For options, you would typically specify a run level, for example init 5. Other options besides run levels are also supported. See the init(8) man page.
The shutdown command is used to bring a system to run level S (the single-user state) after 3 minutes of issuing the command.
$ who root console Apr 15 06:20 $ shutdown -g180 -y Shutdown started. Fri Apr 15 06:20:45 MDT 2015 . Broadcast Message from root (console) on portia Fri Apr 15 06:20:46... The system hostname will be shut down in 3 minutes . . SINGLE USER MODE . Enter user name for system maintenance (control-d to bypass):xxxxxxExample 10 Bringing a System to a Shutdown State
The shutdown command is used to bring a system to run level 0 in five minutes without requiring additional confirmation.
$ who root console Jun 17 12:39... userabc pts/4 Jun 17 12:39 (:0.0) $ shutdown -i0 -g300 -y Shutdown started. Fri Apr 15 06:35:48 MDT 2015 . Broadcast Message from root (console) on murky Fri Apr 15 06:35:48... The system pinkytusk will be shut down in 5 minutes . . Broadcast Message from root (console) on murkey Fri Apr 15 06:40:38... THE SYSTEM hostname IS BEING SHUT DOWN NOW ! ! ! Log off now or risk your files being damaged . . Apr 15 06:41:57 The system is down. Shutdown took 69 seconds. . Press any key to reboot.
If you are bringing the system to run level 0 to turn off power to all devices, see Turning Off Power to System Devices.
Example 11 Bringing a System to a Multiuser StateBy specifying –i6, this shutdown command syntax reboots a system to run level 3 in two minutes. No additional confirmation is required.
$ who root console Jun 14 15:49 (:0) userabc pts/4 Jun 14 15:46 (:0.0) $ shutdown -i6 -g120 -y Shutdown started. Fri Apr 15 06:46:50 MDT 2015 . . Changing to init state 6 - please wait . Apr 15 06:49:40 The system is down. Shutdown took 50 seconds. . rebooting... . hostname console login:Example 12 Shutting Down a System With the init Command
The init command is used to bring a stand-alone system to the run level where it is safe to turn off power.
$ init 0 INIT: New run level: 0 The system is coming down. Please wait. . . The system is down. . Press any key to reboot
See Also
Regardless of the reasons for shutting the system down, you should return to run level 3, where all file resources are available, and users can log in. For instructions on bringing a system back to a multiuser state, see Booting a System.