Linux下的reboot命令是用来重启linux系统的。下面由学习啦小编为大家整理了linux下resboot命令的相关知识,希望对大家有帮助!

linux的reboot命令详解

命令简介:

该命令用来重启Linux系统。相当于Windows系统中的restart命令。

命令语法:

/sbin/reboot [-n] [-w] [-d] [-f] [-i]

reboot [-n] [-w] [-d] [-f] [-i]

命令参数:

参数

长参数

描叙

-d

重新启动时不把数据写入记录文件/var/tmp/wtmp

-f

强制重新开机,不调用shutdown指令的功能。

-h

在系统关机或poweroff之前,将所有的硬盘处于待机模式

-i

关闭网络设置之后再重新启动系统

-n

保存数据后再重新启动系统

-p

When halting the system, do a poweroff. This is the default when halt is called as poweroff

-w

仅做测试,并不真的将系统重新开机,只会把重开机的数据写入/var/log目录下的wtmp记录文件

--help

显示命令在线帮助

linux的reboot命令使用示例

1: 查看reboot命令的帮助信息

[root@DB-Server ~]# reboot --help

usage: reboot [-n] [-w] [-d] [-f] [-h] [-i]

-n: don't sync before halting the system

-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 ~]# man reboot

[root@DB-Server ~]# man reboot

HALT(8) Linux System Administrator鈥檚 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 is not in runlevel 0 or 6, in other words when it鈥檚 running normally, shutdown will be invoked instead (with

the -h or -r flag). For more info see the shutdown(8) manpage.

The rest of this manpage describes the behaviour in runlevels 0 and 6, that is when the systems shutdown scripts are being run.

OPTIONS

-n Don鈥檛 sync before reboot or halt. Note that the kernel and storage drivers may still sync.

-w Don鈥檛 actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).

-d Don鈥檛 write the wtmp record. The -n flag implies -d.

-f Force halt or reboot, don鈥檛 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鈥檙e not the superuser, you will get the message 鈥榤ust be superuser鈥? Users logged in locally on the console can call halt, reboot, and poweroff

without supplying the root password, due to pam_console (8).

NOTES

Under older sysvinit releases , reboot and halt should never be called directly. From release 2.74 on halt and reboot invoke shutdown(8) if the system is

not in runlevel 0 or 6. This means that if halt or reboot cannot find out the current runlevel (for example, when /var/run/utmp hasn鈥檛 been initialized

correctly) shutdown will be called, which might not be what you want. Use the -f flag if you want to do a hard halt or reboot.

The -h flag puts all harddisks in standby mode just before halt or poweroff. Right now this is only implemented for IDE drives. A side effect of putting

the drive in standby mode is that the write cache on the disk is flushed. This is important for IDE drives, since the kernel doesn鈥檛 flush the write-cache

itself before poweroff.

The halt program uses /proc/ide/hd* to find all IDE disk devices, which means that /proc needs to be mounted when halt or poweroff is called or the -h

switch will do nothing.

AUTHOR

Miquel van Smoorenburg, miquels@cistron.nl

SEE ALSO

shutdown(8), init(8), pam_console(8)

Nov 6, 2001 HALT(8)

(END)

2:强制重新开机,不调用shutdown指令的功能

[root@DB-Server ~]# reboot -f

3:关闭网络设置之后再重新启动系统

[root@DB-Server ~]# reboot -i

Broadcast message from root (pts/1) (Mon Jul 28 11:31:28 2014):

The system is going down for reboot NOW!

4:保存数据后再重新启动系统

[root@DB-Server ~]# reboot -n

Broadcast message from root (pts/1) (Mon Jul 28 11:33:57 2014):

The system is going down for reboot NOW!

5:重新启动时不把数据写入记录文件/var/tmp/wtmp

[root@DB-Server ~]# reboot -d

Broadcast message from root (pts/2) (Mon Jul 28 11:23:26 2014):

The system is going down for reboot NOW!

linux命令获取reboot信息,linux的reboot命令相关推荐

  1. linux c 获取屏幕信息,Linux C 获取本机相关信息

    http://www.open-open.com/code/view/14355902499502015.06/* *@Abstract getHostInformation */ #include ...

  2. [获取手机信息]-通过 ADB 命令获取手机信息

    ################################################## 目录 通过 ADB 命令获取手机信息 ADB 常用查看命令 使用 -l 查看设备详细信息 查看机型 ...

  3. php执行who命令,Linux_在Linux系统中使用who和whoami命令获取用户信息,who用法:who [选项]... [ 文件 | - phpStudy...

    在Linux系统中使用who和whoami命令获取用户信息 who用法:who [选项]... [ 文件 | 参数1 参数2 ] 显示当前已登录的用户信息. -a, --all             ...

  4. Linux编程获取网络信息总结

    Linux下C获取所有可用网卡信息 在Linux下开发网络程序时,经常会遇到需要取本地网络接口名.IP.广播地址 .子网掩码或者MAC地址等信息的需求,最常见的办法是配合宏SIOCGIFHWADDR. ...

  5. 利用常见的网络命令获取网络信息

    利用常见的网络命令获取网络信息 提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 利用常见的网络命令获取网络信息 前言 一.利用ipconfig命令获取本地网络信息 二.实训 ...

  6. 金融信息安全实训——利用常见的网络命令获取网络信息

    实训2 金融信息安全实训--利用常见的网络命令获取网络信息 实训目的 掌握常见网络命令使用方法. 学习使用网络命令嗅探网络信息. 学习使用网络命令判断和处理网络问题. 实训准备及注意事项 1.装有Wi ...

  7. Linux登录的shell信息,Linux展示登录Shell信息

    Linux显示登录Shell信息 Linux显示登录Shell信息 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ finger -p Login Name T ...

  8. 怎么用Linux命令查看BIOS信息,LINUX下怎样获取主板的信息用到什么命令

    在Linux系统中,我们常常需要使用命令来实现各种操作,比如从系统中获取主板信息参数,很多用户都不太清楚,本文教给大家在LINUX下怎样获取主板的信息. 方法步骤 dmidecode取出的信息可能不是 ...

  9. 获取linux命令硬盘信息,Linux 下使用命令获取硬盘信息

    本文主要是一些和硬盘相关的命令,包括如何查看硬盘的型号,容量,还有硬盘上的分区情况,来详细了解本机硬盘的状态. hdparm 如果想要在 Linux 下查看硬盘信息,可以使用命令 hdparm .这个 ...

  10. linux保存动态进程信息,Linux 命令 - top: 动态显示进程信息

    命令格式 top -hv | -abcHimMsS -d delay -n iterations -p pid [, pid ...] 命令参数 -a 根据内存的使用排序. -b 以批处理模式操作. ...

最新文章

  1. [技术转载]C#知识点集合 (面试必备)
  2. python 类-Python 类属性和类方法
  3. 如何有效的压缩虚拟磁盘
  4. 修改LR自带的示例程序端口号,Cannot create GUI process-program not found
  5. 8-5如何使用线程池
  6. 94. autoload(2)
  7. 【网络通信 -- SIP 电话】项目实战记录 -- FreeSwitch 服务器搭建与典型 SIP 电话应用
  8. 让ffmpeg支持输出h264格式
  9. 交通灯—VHDL设计
  10. 常识:如何从大陆拨打国际长途电话到境外的方法
  11. mysql basemapper_BaseMapper和继承
  12. nginx日志中$request_body 十六进制字符(\\x22) 引号问题处理记录
  13. Three.js 实现虎年春节3D创意页面
  14. 数据分析之学术前沿分析 任务1:论文数据统计
  15. html多行多列的表单,如何制作多行多列的表格
  16. C# windows窗口应用程序切换主界面的显示内容
  17. TPS27081ADDCR具有电平转换和可调节摆率控制 PFET高侧负载开关TI
  18. JavaScript 附件上传
  19. 记录:仿微信聊天的处理时间功能
  20. 87.【SpringBoot-01】

热门文章

  1. 大数据量点的地图展示,借助PostGIS实现动态点抽稀/聚合效果
  2. linux操作系统原理与应用.第2版 陈莉君 pdf
  3. 小米 红米5A 线刷兼救砖_解账户锁_纯净刷机包_教程
  4. Tracking By Detecting的多目标跟踪
  5. MATLAB必看书籍推荐
  6. Unity3D游戏开发引擎的产品特点
  7. 使用 JW Player 播放RTMP 流
  8. 以太坊实战-attach命令
  9. IOS音视频(四十五)HTTPS 自签名证书 实现边下边播
  10. WPF学习之绘图和动画--DarrenF