Skip to content

Commit f093d37

Browse files
committed
📝 Writing docs.
1 parent bf8fb51 commit f093d37

3 files changed

Lines changed: 56 additions & 32 deletions

File tree

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Linux 系统管理命令
2+
title: Linux 系统管理
33
date: 2018/02/27
44
categories:
55
- linux
@@ -8,22 +8,35 @@ tags:
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 # 重开机。
3649
reboot -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
6982
fi
7083
```
7184

72-
## shutdown
85+
### shutdown
7386

7487
> shutdown 命令用来系统关机命令。shutdown 指令可以关闭所有程序,并依用户的需要,进行重新开机或关机的动作。
7588
>
@@ -85,7 +98,7 @@ shutdown -h now
8598
shutdown +5 "System will shutdown after 5 minutes"
8699
```
87100

88-
## date
101+
### date
89102

90103
> date 命令是显示或设置系统时间与日期。
91104
>
@@ -151,12 +164,11 @@ difference=$(( end - start ))
151164
echo $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
172184
mount -o loop /tmp/image.iso /mnt/cdrom
173185
```
174186

175-
## umount
187+
### umount
176188

177189
> umount 命令用于卸载已经挂载的文件系统。利用设备名或挂载点都能 umount 文件系统,不过最好还是通过挂载点卸载,以免使用绑定挂载(一个设备,多个挂载点)时产生混乱。
178190
>
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Linux 性能管理命令
2+
title: Linux 性能管理
33
date: 2018/02/27
44
categories:
55
- linux
@@ -8,21 +8,33 @@ tags:
88
- command
99
---
1010

11-
# Linux 性能管理命令
11+
# Linux 性能管理
1212

1313
> 关键词:`df`, `du`, `top`, `free`, `iotop`
1414
15-
<!-- TOC depthFrom:2 depthTo:2 -->
15+
<!-- TOC depthFrom:2 depthTo:3 -->
1616

17-
- [df](#df)
18-
- [du](#du)
19-
- [top](#top)
20-
- [free](#free)
21-
- [iotop](#iotop)
17+
- [Linux 性能管理要点](#linux-性能管理要点)
18+
- [命令常见用法](#命令常见用法)
19+
- [df](#df)
20+
- [du](#du)
21+
- [top](#top)
22+
- [free](#free)
23+
- [iotop](#iotop)
2224

2325
<!-- /TOC -->
2426

25-
## df
27+
## Linux 性能管理要点
28+
29+
- 查看磁盘空间 - 使用 [df](#df)
30+
- 查看文件或目录的磁盘空间 - 使用 [du](#du)
31+
- 实时查看系统整体运行状态(如:CPU、内存) - 使用 [top](#top)
32+
- 查看已使用和未使用的内存 - 使用 [free](#free)
33+
- 查看磁盘 I/O 使用状况 - 使用 [iotop](#iotop)
34+
35+
## 命令常见用法
36+
37+
### df
2638

2739
> df 命令用于显示磁盘分区上的可使用的磁盘空间。默认显示单位为 KB。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。
2840
>
@@ -60,7 +72,7 @@ tmpfs 1032204 0 1032204 0% /dev/shm
6072
none 0 0 0 - /proc/sys/fs/binfmt_misc
6173
```
6274

63-
## du
75+
### du
6476

6577
> du 命令也是查看使用空间的,但是与 df 命令不同的是:du 命令是对文件和目录磁盘使用的空间的查看,还是和 df 命令有一些区别的。
6678
>
@@ -112,13 +124,13 @@ root@localhost [test]# du
112124
32 scf
113125
```
114126

115-
## top
127+
### top
116128

117129
> top 命令可以实时动态地查看系统的整体运行情况,是一个综合了多方信息监测系统性能和运行信息的实用工具。通过 top 命令所提供的互动式界面,用热键可以管理。
118130
>
119131
> 参考:http://man.linuxde.net/top
120132
121-
## free
133+
### free
122134

123135
> free 命令可以显示当前系统未使用的和已使用的内存数目,还可以显示被内核使用的内存缓冲区。
124136
>
@@ -139,7 +151,7 @@ Mem: 2016 1973 42 0 163 1497
139151
Swap: 4094 0 4094
140152
```
141153

142-
## iotop
154+
### iotop
143155

144156
> iotop 命令是一个用来监视磁盘 I/O 使用状况的 top 类工具。iotop 具有与 top 相似的 UI,其中包括 PID、用户、I/O、进程等相关信息。Linux 下的 IO 统计工具如 iostat,nmon 等大多数是只能统计到 per 设备的读写情况,如果你想知道每个进程是如何使用 IO 的就比较麻烦,使用 iotop 命令可以很方便的查看。
145157
>

docs/linux/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
- [Linux 文件内容查看命令](03.Linux文件内容查看编辑.md) - 关键词:`cat`, `head`, `tail`, `more`, `less`, `sed`, `vi`, `grep`
88
- [Linux 文件压缩和解压](04.Linux文件压缩和解压.md) - 关键词:`tar`, `gzip`, `zip`, `unzip`
99
- [Linux 用户管理](05.Linux用户管理.md) - 关键词:`groupadd`, `groupdel`, `groupmod`, `useradd`, `userdel`, `usermod`, `passwd`, `su`, `sudo`
10-
- [Linux 系统管理命令](Linux系统管理命令.md) - 关键词:`reboot`, `exit`, `shutdown`, `date`, `mount`, `umount`
11-
- [Linux 性能管理命令](Linux性能管理命令.md) - 关键词:`df`, `du`, `top`, `free`, `iotop`
10+
- [Linux 系统管理](06.Linux系统管理.md) - 关键词:`reboot`, `exit`, `shutdown`, `date`, `mount`, `umount`
11+
- [Linux 性能管理](07.Linux性能管理.md) - 关键词:`df`, `du`, `top`, `free`, `iotop`
1212
- [Linux 进程管理命令](Linux进程管理命令.md) - 关键词:`ps`, `kill`, `systemctl`, `service`, `crontab`
1313
- [Linux 网络应用命令](Linux网络应用命令.md) - 关键词:`curl`, `wget`, `telnet`, `ip`, `hostname`, `ifconfig`, `route`, `ssh`, `ssh-keygen`, `iptables`
1414
- [Linux 网络测试命令](Linux网络测试命令.md) - 关键词:`host`, `nslookup`, `nc`/`netcat`, `dig`, `ping`, `traceroute`, `netstat`

0 commit comments

Comments
 (0)