本文讲诉了Linux命令学习总结:shutdown命令,具体如下:
命令简介:
该命令可以安全关闭或者重新启动系统。你没有看错,shutdown命令不仅可以关闭系统、也可以重启Linux系统。
命令语法:
/sbin/shutdown [-t sec] [-arkhncfFHP] time [warning-message]
命令参数:
参数
长参数
描叙
-a
Use /etc/shutdown.allow.
-c
中断关机:当执行"shutdown -h 12:00"指令时,只要按+键就可以中断关机的指令
-f
重新启动时不进行磁盘检测(fsck)
-F
重新启动时进行磁盘检测(fsck)
-h
关闭电源
-k
模拟关机(不是真的关机),只是向登录者发送警告信息出去!
-n
不调用init进程进行关机,而是强行关机
-r
关闭系统然后重新启动,类似于Windows平台restart
-t
延迟关机的时间
-w
仅做测试,并不真的将系统重新开机,只会把重开机的数据写入/var/log目录下的wtmp记录文件
--help
显示命令在线帮助
使用示例:
1: 查看reboot命令的帮助信息
[root@db-server ~]# shutdown --help shutdown: invalid option -- - Usage: shutdown [-akrhHPfnc] [-t secs] time [warning message] -a: use /etc/shutdown.allow -k: don't really shutdown, only warn. -r: reboot after shutdown. -h: halt after shutdown. -P: halt action is to turn off power. -H: halt action is to just halt. -f: do a 'fast' reboot (skip fsck). -F: Force fsck on reboot. -n: do not go through "init" but go down real fast. -c: cancel a running shutdown. -t secs: delay between warning and kill signal. ** the "time" argument is mandatory! (try "now") ** [root@db-server ~]#
[root@db-server ~]# man shutdown SHUTDOWN(8) Linux System Administrator鈥檚 Manual SHUTDOWN(8) NAME shutdown - bring the system down SYNOPSIS /sbin/shutdown [-t sec] [-arkhncfFHP] time [warning-message] DESCRIPTION shutdown brings the system down in a secure way. All logged-in users are notified that the system is going down, and login(1) is blocked. It is possible to shut the system down immediately or after a specified delay. All processes are first notified that the system is going down by the signal SIGTERM. This gives programs like vi(1) the time to save the file being edited, mail and news processing programs a chance to exit cleanly, etc. shutdown does its job by signalling the init process, asking it to change the runlevel. Runlevel 0 is used to halt the system, runlevel 6 is used to reboot the system, and runlevel 1 is used to put to system into a state where administrative tasks can be performed; this is the default if neither the -h or -r flag is given to shut- down. To see which actions are taken on halt or reboot see the appropriate entries for these runlevels in the file /etc/inittab. OPTIONS -a Use /etc/shutdown.allow. -t sec Tell init(8) to wait sec seconds between sending processes the warning and the kill signal, before changing to another runlevel. -k Don鈥檛 really shutdown; only send the warning messages to everybody. -r Reboot after shutdown. -h Halt or poweroff after shutdown. -H Halt action is to halt or drop into boot monitor on systems that support it. -P Halt action is to turn off the power. -n [DEPRECATED] Don鈥檛 call init(8) to do the shutdown but do it ourself. The use of this option is dis- couraged, and its results are not always what you鈥檇 expect. -f Skip fsck on reboot. -F Force fsck on reboot. -c Cancel an already running shutdown. With this option it is of course not possible to give the time argu- ment, but you can enter a explanatory message on the command line that will be sent to all users. time When to shutdown. warning-message Message to send to all users. The time argument can have different formats. First, it can be an absolute time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm is the minute of the hour (in two digits). Second, it can be in the for- mat +m, in which m is the number of minutes to wait. The word now is an alias for +0. If shutdown is called with a delay, it creates the advisory file /etc/nologin which causes programs such as login(1) to not allow new user logins. Shutdown removes this file if it is stopped before it can signal init (i.e. it is cancelled or something goes wrong). It also removes it before calling init to change the runlevel. The -f flag means 鈥榬eboot fast鈥"htmlcode">[root@db-server ~]# shutdown -h now Broadcast message from root (pts/1) (Sat Jan 10 18:51:34 2015): The system is going down for system halt NOW!3:系统2分钟后重新启动,其中+m表示几分钟后关机或开机。
[root@db-server ~]# shutdown -r +2 Broadcast message from root (pts/2) (Sat Jan 10 19:56:00 2015): The system is going DOWN for reboot in 2 minutes!4:设置系统在那个时间点关机
[root@db-server ~]# shutdown -h 12:30或
[root@db-server ~]# shutdown -h 12:30 & [1] 4578最好是使用命令&将关机命令至于后台处理。不影响当前其它操作。
设置多久时间后执行shutdown命令。时间参数有hh:mm或+m两种模式。hh:mm格式表示在几点几分执行shutdown命令。例如 “shutdown 10:45”表示将在10:45执行shutdown.+m表示m分钟后执行shutdown.比较特别的用法是以now表示立即执行shutdown. 值得注意的是这部分参数不能省略。另外,需要注意如果现在已经22:30,你执行了shutdown -h 22:00 & 那么第二天才会关机。
5:将前一个shutdown命令取消息
如下所示,执行了下面命令让Linux在12:30关机,但是如果发现这个时间点不合适,那么可以使用CTRL+C取消
[root@db-server ~]# shutdown -h 12:30 Shutdown cancelled. [root@db-server ~]#也可以在另外一个命令窗口执行下面命令
[root@db-server ~]# shutdown -c6:向所有登录的用户发出信息
[root@db-server ~]# shutdown -k "now" Broadcast message from root (pts/2) (Sat Jan 10 20:09:14 2015): The system is going down to maintenance mode NOW! Shutdown cancelled.另外登录的会话窗口会收到如下信息
[root@db-server ~]# [root@db-server ~]# Broadcast message from root (pts/2) (Sat Jan 10 20:11:34 2015): The system is going down to maintenance mode NOW!一般使用下面语法,如下所示
[root@db-server ~]# shutdown -k now "The Server will shutdown now" Broadcast message from root (pts/1) (Sat Jan 10 20:14:54 2015): The Server will shutdown now The system is going down to maintenance mode NOW! Shutdown cancelled.7:重新启动时不进行磁盘检测
[root@db-server ~]# shutdown -fr now Broadcast message from root (pts/1) (Sat Jan 10 20:23:59 2015): The system is going down for reboot NOW!8:在多少秒后关闭系统并给用户发送提示信息
[root@db-server ~]# shutdown -t 10 -h now "System will shutdown 10 sencond later" Broadcast message from root (pts/1) (Sat Jan 10 20:33:36 2015): System will shutdown 10 sencond later The system is going down for system halt NOW!以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新日志
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]