Introduction to Commands:
This command is used to reboot the Linux system. Corresponds to the restart command in the Windows system.
Command syntax:
/sbin/reboot [-N] [-W] [-d] [-f] [-i]
Or
Reboot [-n] [-W] [-d] [-f] [-i]
Command parameters:
Parameters |
Long parameters |
Description |
-D |
|
Do not write data to the record file when restarting/var/tmp/wtmp |
-F |
|
Forces a reboot and does not invoke the functionality of the shutdown directive. |
-H |
|
Put all the hard drives in standby mode before the system shuts down or Poweroff |
-I. |
|
Reboot the system after shutting down network settings |
-N |
|
Save data before restarting system |
-P |
|
When halting the system, do a poweroff. This is the default when halt is called as Poweroff |
-W |
|
Only testing, does not really reboot the system, will only be the power-on of the data in the/var/log directory to write the wtmp record file |
|
--help |
Show Commands online Help |
Use examples:
1: View Help for the reboot command
[Root@db-server ~]# reboot--help
Usage:reboot [-n] [-W] [-d] [f] [H] [i]
-n:don ' t sync before halting the SY Stem
-w:only Write a wtmp reboot record and exit.
-d:don ' t write a wtmp record.
-f:force Halt/reboot, don ' t call shutdown.
-h:put harddisks in standby mode.
-i:shut down all network interfaces.
[Root@db-server ~]# Mans reboot
[Root@db-server ~]# man reboot HALT (8) Linux System Administrator Transmission's Manual HALT (8) NAME HALT, reboot,
Poweroff-stop the system. Synopsis/sbin/halt [-N] [-W] [-d] [f] [-i] [P] [-h]/sbin/reboot [-n] [-W] [-d] [-f] [-i]/sbin/poweroff [- N] [-W] [-d] [f] [-i] [h] DESCRIPTION Halt notes that the system is being brought down in the File/var/log/wtmp,
And then either tells the kernel to halt, reboot or poweroff the system. If halt or reboot is called when the system isn't in RunLevel 0 or 6, in the other words when it transmission's, running normally 'll is invoked instead (with The-h or-r flag).
For more info, shutdown (8) manpage. The rest of this manpage describes the behaviour in Runlevels 0 and 6, which is when the systems shutdown scripts are being
Run. Options-n Don transmission 檛 sync before reboot or halt.
Note that the kernel and storage drivers may still sync. -W Don transmission 檛 actually reboot or halt but only write the WTMP record (in The/var/log/wtmp file). -D Don Transmission 檛 write the wtmp record.
The-n flag implies-d.
-F Force halt or reboot, Don transmission 檛 call shutdown (8).
-I shut down all network interfaces just before halt or reboot.
-H put all harddrives on the system in standby mode just before halt or Poweroff. -p When halting the system, do a poweroff.
This is the "default when" halt is called as Poweroff. Diagnostics If You transmission 檙 e isn't the superuser, you'll get the message transmission Shiang the UST to be Superuser transmission? Users logged in locally on the console can call halt, reboot, and Poweroff without the root supplying, password to
Pam_console (8). NOTES Under older Sysvinit releases reboot and halt should never is called. From release 2.74 on halt and reboot invoke shutdown (8) If the system isn't in RunLevel 0 or 6. This means so if halt or reboot cannot find out of the current runlevel (for example, when/var/run/utmp hasn transmission, 檛 been Initia Lized correctly) ShuTdown'll be called, which might is what you want.
Use THE-F flag If you are want to do a hard halt or reboot. The-h flag puts all harddisks in standby mode just before or halt. You are only implemented for IDE drives. A side effect of putting the drive in standby mode is this write cache on the disk is flushed.
This is important a for IDE drives since the kernel doesn transmission 檛 flush the write-cache itself. The halt program uses/proc/ide/hd* to find all IDE disk devices, which means that/proc-needs to is mounted when halt or
Poweroff is called or the-h switch would do nothing.
AUTHOR Miquel van Smoorenburg, miquels@cistron.nl, ALSO shutdown (8), init (8), Pam_console (8) Nov 6, 2001 HALT (8) (end)
2: Force reboot, do not invoke the function of shutdown instruction
[Root@db-server ~]# Reboot-f
3: Reboot the system after shutting down network settings
[Root@db-server ~]# reboot-i
broadcast message from root (PTS/1) (Mon June 11:31:28 2014): The
system is going Down for reboot now!
4: Save the data before restarting the system
[Root@db-server ~]# reboot-n
broadcast message from root (PTS/1) (Mon June 11:33:57 2014): The
system is going Down for reboot now!
5: Do not write data to the record file when restarting/var/tmp/wtmp
[Root@db-server ~]# reboot-d
broadcast message from root (PTS/2) (Mon June 11:23:26 2014): The
system is going Down for reboot now!
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.