命令简介:

该命令用来重启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

显示命令在线帮助

 

使用示例:

 

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命令的更多相关文章

  1. 基于linux与busybox的reboot命令流程分析

    http://www.xuebuyuan.com/736763.html 基于Linux与Busybox的Reboot命令流程分析 ********************************** ...

  2. 【Python Learning第一篇】Linux命令学习及Vim命令的使用

    学了两天,终于把基本命令学完了,掌握以后可以当半个程序员了♪(^∇^*) 此文是一篇备忘录或者查询笔记,如果哪位大佬看上了并且非常嫌弃的话,还请大佬不吝赐教,多多包涵 以下是我上课做的一些笔记,非常的 ...

  3. Linux命令学习神器!命令看不懂直接给你解释!

    大家都知道,Linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务. 一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么 ...

  4. linux shell 学习笔记--内部命令学习

    .基本命令 新手必须要掌握的初级命令 ls 基本的列出所有文件的命令.但是往往就是因为这个命令太简单,所以我们总是低估它.比如 ,用 -R 选项,这是递归选项,ls 将会以目录树的形式列出所有文件, ...

  5. Linux命令学习笔记- vmstat命令实战详解

    vmstat命令是最常见的Linux/Unix监控工具,可以展现给定时间间隔的服务器的状态值,包括服务器的CPU使用率,内存使用,虚拟内存交换情况,IO读写情况.这个命令是我查看Linux/Unix最 ...

  6. LINUX基础学习之基础命令(2)--2019-11-18

    1.ls  :命令(list):列出指定目录下的内容 用法:ls [选项] [文件名...] [root@Redhat-7-43 ~]# which ls alias ls='ls --color=a ...

  7. Linux基础学习之基础命令(1)--2019-11-14

    查看命令路径其他方法: which 命令: which [options] [--] programname [...] -a:显示所有匹配的程序文件,而非第一个: --skip-alias:略过别名 ...

  8. Linux命令学习总结: file命令

    命令简介: 该命令用来识别文件类型,也可用来辨别一些文件的编码格式.它是通过查看文件的头部信息来获取文件类型,而不是像Windows通过扩展名来确定文件类型的. 执行权限 :All User 指令所在 ...

  9. Linux命令学习之xargs命令

    xargs命令是给其他命令传递参数的一个过滤器,也是组合多个命令的一个工具.它擅长将标准输入数据转换成命令行参数,xargs能够处理管道或者stdin并将其转换成特定命令的命令参数.xargs也可以将 ...

  10. linux命令学习笔记-eval命令详解

    功能说明:重新运算求出参数的内容. 语 法:eval [参数] 补充说明:eval可读取一连串的参数,然后再依参数本身的特性来执行. 参 数:参数不限数目,彼此之间用分号分开. .eval命令将会首先 ...

随机推荐

  1. 使用Spire.Barcode程序库生成二维码

    使用Spire.Barcode程序库生成二维码 某天浏览网页发现了一个二维码的程序库.它的描述说他可以扫描二维码图像.我很感兴趣,想试试他是不是会有用.所以我就用了些方法扫描二维码图像来测试一下.结果 ...

  2. 一次发现underscore源码bug的经历以及对学术界『拿来主义』的思考

    事情是如何发生的 最近干了件事情,发现了 underscore 源码的一个 bug.这件事本身并没有什么可说的,但是过程值得我们深思,记录如下,各位看官仁者见仁智者见智. 平时有浏览园区首页文章的习惯 ...

  3. 重温JSP学习笔记--三大指令九大内置对象

    最近在温习javaweb的相关基础知识,鉴于我弄丢了记满了整整一本的笔记,决定以后把笔记和一些学习上的心得以及碰到的一些问题统统都放在网上,今天看了一下jsp的相关基础,以下是笔记: JSP三大指令: ...

  4. 软件工程-构建之法 理解C#一小段程序

    一.前言 老师给出的要求: 阅读下面程序,请回答如下问题: 问题1:这个程序要找的是符合什么条件的数? 问题2:这样的数存在么?符合这一条件的最小的数是什么? 问题3:在电脑上运行这一程序,你估计多长 ...

  5. Python的安装和详细配置

    Python是一种面向对象.解释型计算机程序设计语言.被认为是比较好的胶水语言.至于其他的,你可以去百度一下.本文仅介绍python的安装和配置,供刚入门的朋友快速搭建自己的学习和开发环境.本人欢迎大 ...

  6. [linux]ssh(转载)

    ssh登陆问题 SSH分客户端openssh-client和openssh-server 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则su ...

  7. Handler类、异步线程和Message类的参数传递

    声明HandlerThread对象,实现了使用Looper来处理消息队列的功能 //这个类由Android操作系统提供 HandlerThread handlerThread = new Handle ...

  8. Moon.Orm常见问题问答FAQ

    有问题在评论,我看到邮件会尽快回复 1.重点了解Db里面的方法.这是核心. 2.关于查询语句MQL:http://www.cnblogs.com/humble/p/3380065.html 3.关于如 ...

  9. Epplus

    简介:Epplus是一个使用Open Office XML(Xlsx)文件格式,能读写Excel 2007/2010文件的开源组件 功效:支持对excel文档的汇入汇出,图表(excel自带的图表基本 ...

  10. 自己封装的一个LoadRes组件

    这两周一直太忙,没有好好处理上上上周遇到的一个让我加班到凌晨的问题,这个问题是判断flash的加载. 之前的思路是让flash的人在制作flash的时候,加入了一个回调方法,该方法再会回调我页面的方法 ...