与关机相关的几个命令
来源:互联网 发布:origin软件绘图 编辑:程序博客网 时间:2024/05/29 07:32
一、用init命令实现相关功能
linux有7个开机选项,用init命令可以选择其中的一个开机选项,这7个开机选项的意思见inittab文件的注释
[root@yang-centos ~]# init 0 #马上关机
[root@yang-centos ~]# init 3 #以命令行方式重新启动
[root@yang-centos ~]# init 5 #以窗口(X window)方式重新启动
[root@yang-centos ~]# init 6 #以默认方式重新启动,默认方式在inittab文件中定义
二、以shutdown命令实现相关功能
[root@yang-centos ~]# shutdown -P now #马上关机
[root@yang-centos ~]# shutdown -r now #马上重新启动
[root@yang-centos ~]# shutdown -h 《时间值》 #在某个时间关机,如果时间值为0,则马上关机
三、reboot、halt、poweroff命令
[root@yang-centos ~]#reboot #马上重新启动
[root@yang-centos ~]# halt #马上关机
[root@yang-centos ~]# poweroff #马上关机
#-------inittab 文件内容------------------------
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
- 与关机相关的几个命令
- 【Bash百宝箱】与Linux关机、重启相关的几个命令
- 与操作目录相关的几个命令
- 与管道相关的几个命令处理
- Linux下的几个关机命令
- CentOS系统中与时间相关的几个命令
- Linux基础学习笔记之与关机、重启相关的命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- Linux的关机与重启命令
- 关机与重启的命令
- 安装Eclipse Maven插件的几种方法
- 润乾报表——样式的优先级
- 前后台系统VS嵌入式OS,何时该上OS?
- Linux系统如何平滑生效NAT-DNAT改进以及解释
- codeforce 192 div2解题报告
- 与关机相关的几个命令
- hdu 1664 BFS + 数论
- msp430单片机之时钟模块
- mutex与semaphore的区别
- UVaOJ10820 - Send a Table
- 【绿色易维PHP代码加密专家1.3下载】
- 加载第一个rootkit
- hdu1026 Ignatius and the Princess I BFS
- HTML中的相对路径与绝对路径