11---
2- title : Linux 系统管理命令
2+ title : Linux 系统管理
33date : 2018/02/27
44categories :
55 - linux
88 - command
99---
1010
11- # Linux 系统管理命令
11+ # Linux 系统管理
1212
1313> 关键词:` reboot ` , ` exit ` , ` shutdown ` , ` date ` , ` mount ` , ` umount `
1414
15- <!-- TOC depthFrom:2 depthTo:2 -->
15+ <!-- TOC depthFrom:2 depthTo:3 -->
1616
17- - [ reboot] ( #reboot )
18- - [ exit] ( #exit )
19- - [ shutdown] ( #shutdown )
20- - [ date] ( #date )
21- - [ mount] ( #mount )
22- - [ umount] ( #umount )
17+ - [ Linux 系统管理要点] ( #linux-系统管理要点 )
18+ - [ 命令常见用法] ( #命令常见用法 )
19+ - [ reboot] ( #reboot )
20+ - [ exit] ( #exit )
21+ - [ shutdown] ( #shutdown )
22+ - [ date] ( #date )
23+ - [ mount] ( #mount )
24+ - [ umount] ( #umount )
2325
2426<!-- /TOC -->
2527
26- ## reboot
28+ ## Linux 系统管理要点
29+
30+ - 重新启动 Linux 操作系统 - 使用 [ reboot] ( #reboot )
31+ - 退出 shell,并返回给定值 - 使用 [ exit] ( #exit )
32+ - 关闭系统 - 使用 [ shutdown] ( #shutdown )
33+ - 查看或设置系统时间与日期 - 使用 [ date] ( #date )
34+ - 挂载文件系统 - 使用 [ mount] ( #mount )
35+ - 取消挂载文件系统 - 使用 [ umount] ( #umount )
36+
37+ ## 命令常见用法
38+
39+ ### reboot
2740
2841> reboot 命令用来重新启动正在运行的 Linux 操作系统。
2942>
@@ -36,7 +49,7 @@ reboot # 重开机。
3649reboot -w # 做个重开机的模拟(只有纪录并不会真的重开机)。
3750```
3851
39- ## exit
52+ ### exit
4053
4154> exit 命令同于退出 shell,并返回给定值。在 shell 脚本中可以终止当前脚本执行。执行 exit 可使 shell 以指定的状态值退出。若不设置状态值参数,则 shell 以预设值退出。状态值 0 代表执行成功,其他值代表执行失败。
4255>
@@ -69,7 +82,7 @@ if [ "$EXCODE" == "0" ]; then
6982fi
7083```
7184
72- ## shutdown
85+ ### shutdown
7386
7487> shutdown 命令用来系统关机命令。shutdown 指令可以关闭所有程序,并依用户的需要,进行重新开机或关机的动作。
7588>
@@ -85,7 +98,7 @@ shutdown -h now
8598shutdown +5 " System will shutdown after 5 minutes"
8699```
87100
88- ## date
101+ ### date
89102
90103> date 命令是显示或设置系统时间与日期。
91104>
@@ -151,12 +164,11 @@ difference=$(( end - start ))
151164echo $difference seconds.
152165```
153166
154- ## mount
167+ ### mount
155168
156169> mount 命令用于挂载文件系统到指定的挂载点。此命令的最常用于挂载 cdrom,使我们可以访问 cdrom 中的数据,因为你将光盘插入 cdrom 中,Linux 并不会自动挂载,必须使用 Linux mount 命令来手动完成挂载。
157170>
158- > 参考:http://man.linuxde.net/mount
159- > https://blog.csdn.net/weishujie000/article/details/76531924
171+ > 参考:http://man.linuxde.net/mount > https://blog.csdn.net/weishujie000/article/details/76531924
160172
161173示例:
162174
@@ -172,7 +184,7 @@ mount -o ro /dev/hda1 /mnt
172184mount -o loop /tmp/image.iso /mnt/cdrom
173185```
174186
175- ## umount
187+ ### umount
176188
177189> umount 命令用于卸载已经挂载的文件系统。利用设备名或挂载点都能 umount 文件系统,不过最好还是通过挂载点卸载,以免使用绑定挂载(一个设备,多个挂载点)时产生混乱。
178190>
0 commit comments