pavement

Shutdown

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
 
  '''now''' is a valid keyword for the "time" argument.
 
  '''now''' is a valid keyword for the "time" argument.
  
'''shutdown -h now''' will halt the machine immediately - all users will be logged out forcefully, all pending writes will be performed, all disks sync'd, and the system will halt and wait for reboot.
+
'''shutdown -h now''' will halt the machine immediately - all users will be logged out forcefully, all pending writes will be performed, all disks sync'd, and the system will halt and wait for reboot.
  
'''shutdown -h +5''' will broadcast a console message to all currently logged in users warning them that the system will shutdown in 5 minutes, at which time it will forcefully log them out and do so.
+
'''shutdown -h +5''' will broadcast a console message to all currently logged in users warning them that the system will shutdown in 5 minutes, at which time it will forcefully log them out and do so.
  
'''shutdown -r 0412310000''' will broadcast a console message warning users of a shutdown at midnight on New Year's Eve of 2004, and at that time will forcefully log them out, halt the system, and automatically reboot.
+
'''shutdown -r 0412310000''' will broadcast a console message warning users of a shutdown at midnight on New Year's Eve of 2004, and at that time will forcefully log them out, halt the system, and automatically reboot.
  
 
Compare to [[init]].
 
Compare to [[init]].
  
 
[[Category:System Commands]] [[Category:Common Tasks]]
 
[[Category:System Commands]] [[Category:Common Tasks]]

Revision as of 08:09, 14 September 2004

Used to shutdown a machine. shutdown requires two arguments: a command and a time.

Common Flags and arguments

-h will halt the machine
-r will reboot the machine
-p will turn the power off after shutdown (only works on some BIOSes)
-k will send out a message that the machine will reboot, but not actually do it

now is a valid keyword for the "time" argument.

shutdown -h now will halt the machine immediately - all users will be logged out forcefully, all pending writes will be performed, all disks sync'd, and the system will halt and wait for reboot.

shutdown -h +5 will broadcast a console message to all currently logged in users warning them that the system will shutdown in 5 minutes, at which time it will forcefully log them out and do so.

shutdown -r 0412310000 will broadcast a console message warning users of a shutdown at midnight on New Year's Eve of 2004, and at that time will forcefully log them out, halt the system, and automatically reboot.

Compare to init.

Personal tools