shutdown(8) System Manager’s Manual shutdown(8)

NAME
shutdown - bring the system down

SYNOPSIS
shutdown [OPTION]… TIME [MESSAGE]

DESCRIPTION
shutdown arranges for the system to be brought down in a safe way. All
logged-in users are notified that the system is going down and, within
the last five minutes of TIME, new logins are prevented.

   TIME  may  have  different  formats, the most common is simply the word'now' which will bring the system down immediately.  Other  valid  for‐mats  are  +m,  where m is the number of minutes to wait until shuttingdown and hh:mm which specifies the time on the 24hr clock.If no option is specified, the default action is to  bring  the  systemdown into single-user mode.Once  TIME  has elapsed, shutdown sends a request to the init(8) daemonto bring the system down into the appropriate runlevel.This is performed by emitting the runlevel(7) event, which includes thenew runlevel in the RUNLEVEL environment variable as well as the previ‐ous runlevel (obtained from the environment or from  /var/run/utmp)  inthe  PREVLEVEL  variable.  An additional INIT_HALT variable may be set,this will contain the value HALT when bringing the system down for haltand POWEROFF when bringing the system down for power off.

OPTIONS
-r Requests that the system be rebooted after it has been brought
down.

   -h     Requests that the system be either halted or powered  off  afterit has been brought down, with the choice as to which left up tothe system.-H     Requests that the system be halted after  it  has  been  broughtdown.-P     Requests  that  the  system  be  powered  off  after it has beenbrought down.-c     Cancels a running shutdown.  TIME is  not  specified  with  thisoption, the first argument is MESSAGE.-k     Only  send  out  the warning messages and disable logins, do notactually bring the system down.

ENVIRONMENT
RUNLEVEL
shutdown will read the current runlevel from this environment
variable if set in preference to reading from /var/run/utmp

FILES
/var/run/utmp
Where the current runlevel will be read from; this file will
also be updated with the new runlevel.

   /var/log/wtmpA new runlevel record will be appended to this file for the  newrunlevel.

NOTES
The Upstart init(8) daemon does not keep track of runlevels itself,
instead they are implemented entirely by its userspace tools.

   See runlevel(7) for more details.

AUTHOR
Written by Scott James Remnant scott@netsplit.com

REPORTING BUGS
Report bugs at https://launchpad.net/upstart/+bugs

COPYRIGHT
Copyright © 2009 Canonical Ltd.
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

SEE ALSO
runlevel(7) init(8) telinit(8) reboot(8)

Upstart 2009-07-09 shutdown(8)

以上为man shutdown 手册信息。下面看点中文的。

关机命令 shutdown

  好像ubuntu的终端中默认的是当前用户的命令,只是普通用户,因此在终端器中可以使用sudo -sh 转换到管理员root用户下执行命令。

  1)shutdown –help

  可以查看shutdown命令如何使用,当然也可以使用man shutdown命令。

  2) shutdown -h now 现在立即关机

  3)shutdown -r now 现在立即重启

  4)shutdown -r +3 三分钟后重启

  5)shutdown -h +3 “The System will shutdown after 3 minutes” 提示使用者将在三分钟后关机

  6)shutdown -r 20:23 在20:23时将重启计算机

  7)shutdown -r 20:23 & 可以将在20:23时重启的任务放到后台去,用户可以继续操作终端

  2中断命令

  1)执行完命令后(若没有转到后台),可以使用CTRL+C来中止命令

  2)kill 程序编码

  当命令在后台执行时系统会返回一个程序编码,例如:在使用 shutdown -r 20:23 & 系统返回系统编码:4905

  我们可以使用kill 4905来中止重启命令

  3ps aux | grep 程序编号

  我们如果知道程序的编号,我们可以使用ps aux |grep 程序编号来查询该程序编号对应的命令是什么。

  例如上面的程序编号为4905 ,我们可以使用ps aux | grep 4905 就可以查到 shutdown -r 20:23 & 的命令

  halt—-最简单的关机命令

  其实halt就是调用shutdown -h。halt执行时﹐杀死应用进程﹐执行sync系统调用﹐文件系统写操作完成后就会停止内核。

  参数说明:

  [-n] 防止sync系统调用﹐它用在用fsck修补根分区之后﹐以阻止内核用老版本的超级块〔superblock〕覆盖修补过的超级块。

  [-w] 并不是真正的重启或关机﹐只是写wtmp〔/var/log/wtmp〕纪录。

  [-d] 不写wtmp纪录〔已包含在选项[-n]中〕。

  [-f] 没有调用shutdown而强制关机或重启。

  [-i] 关机〔或重启〕前﹐关掉所有的网络接口。

  [-p] 该选项为缺省选项。就是关机时调用poweroff。

ubuntu下shutdown命令详解相关推荐

  1. ubuntu下route命令详解

    ubuntu下route命令详解 1.显示路由表 route -n 2.临时路由设置,重启网卡失效 #添加一条路由(发往192.168.62这个网段的全部要经过网关192.168.1.1) route ...

  2. ubuntu下sed命令详解 - Dicky - 开源中国社区

    ubuntu下sed命令详解 - Dicky - 开源中国社区 ubuntu下sed命令详解 - Dicky - 开源中国社区 ubuntu下sed命令详解     7人收藏此文章, 我要收藏 发表于 ...

  3. Ubuntu下apt-get命令详解

    在Ubuntu下,apt-get近乎是最常用的shell命令之一了,因为他是Ubuntu通过新立得安装软件的常用工具命令. 本文列举了常用的APT命令参数: apt-cache search pack ...

  4. ubuntu下svn命令详解

    转自:https://blog.csdn.net/ameyume/article/details/6320694 SVN作为日常开发中不可缺少的工具,今天终于开始在Ubuntu下使用了. 1.首先需要 ...

  5. ubuntu下sed命令详解

    sed简介 sed是一种非交互式的流编辑器,可动态编辑文件.所谓非交互式是说,sed和传统的文本编辑器不同,并非和使用者直接互动,sed处理的对象是文件的数据流(称为stream/流). sed的工作 ...

  6. Ubuntu下apt-get命令详解(转)

    原文:https://www.cnblogs.com/liyu925/p/6100388.html 转载于:https://www.cnblogs.com/olivertian/p/11017247. ...

  7. 虚拟机VMware的Ubuntu下安装tensorflow详解

    这里笔者已经安装好了虚拟机并安装了Ubuntu系统,并且虚拟机可以联网,因此就直接开始介绍下面的步骤.网上博文很乱,特意整理,以供参考. 虚拟机VMware的Ubuntu下安装tensorflow详解 ...

  8. linux下dd命令详解

    linux下dd命令详解    名称: dd 使用权限: 所有使用者dd 这个指令在 manual 里的定义是 convert and copy a file 使用方式: dd [option] 如果 ...

  9. linux vsftpd用法,Linux_LINUX系统下vsftpd 命令详解,FTP命令是Internet用户使用最频 - phpStudy...

    LINUX系统下vsftpd 命令详解 FTP命令是Internet用户使用最频繁的命令之一,不论是在DOS还是UNIX操 作系统下使用FTP,都会遇到大量的FTP内部命令. 熟悉并灵活应用FTP的内 ...

最新文章

  1. Drainage Ditches
  2. C#实现发送手机短信
  3. WaitForSingleObject的用法举例
  4. ArcEngine 获取HDF文件中的子文件
  5. 等待链表_调度(准备运行)链表
  6. String为null
  7. 程序员幽默:年后上班综合症,你中了几招?!!
  8. php屏蔽审查元素,js屏蔽F12审查元素,禁止修改页面代码等实现代码
  9. 安全云服务的定义和特征
  10. javaScript原型链继承
  11. 计算机专业建设会议纪要,本学期第六次专业建设工作会议纪要
  12. 市政基础设施工程与建筑工地施工人员安全管理实名制通道系统的应用与解决方案
  13. ThinkPadnbsp;E40nbsp;硬盘异响…
  14. 【PROTEUS】使用PROTEUS与电脑串口调试助手进行通讯
  15. 搜索词纠错(拼写检查)、相关搜索的原理与实现
  16. 「Nginx实战」中学到的东西用在面试上,面试官都被怼得哑口无言
  17. Java基础eclipse版(二)——JDK、Eclipse的下载与安装
  18. 音频技术的下一个“热点”,会出现在哪个领域?丨一期一会 • 音频工程师专场
  19. 前缀和的n个神奇操作
  20. 阿里云安装nacos

热门文章

  1. Javascript中分号的问题
  2. oracle 朱志辉_《DB2设计、管理与性能优化艺术》(王飞鹏,李玉明,朱志辉,王富国)【摘要 书评 试读】- 京东图书...
  3. 诺基亚确实可以当榔头用,验证了
  4. ios 扫码枪外设 键盘模式_让iPad Pro秒变MacBook,这款外设键盘居然还能这么玩儿!...
  5. Markdown之时序图sequenceDiagram高阶语法(十三)
  6. PID算法的数字离散化
  7. 跟随狂神学Java-15
  8. BUUCTF Crypto题目记录
  9. 前台Autoform 选择下拉框的值进行判断(js)
  10. C#winForm程序与html JS交互调用