Skip to content

Commit 25f9630

Browse files
committed
更新了Linux文档
1 parent a748707 commit 25f9630

File tree

1 file changed

+85
-6
lines changed

1 file changed

+85
-6
lines changed

Day31-35/玩转Linux操作系统.md

+85-6
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,45 @@ build environment:
968968
### 配置服务
969969
970970
1. 启动服务。
971+
972+
```Shell
973+
974+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# systemctl start firewalld
975+
```
976+
971977
2. 终止服务。
978+
979+
```Shell
980+
981+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# systemctl stop firewalld
982+
```
983+
972984
3. 重启服务。
985+
986+
```Shell
987+
988+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# systemctl restart firewalld
989+
```
990+
973991
4. 查看服务。
992+
993+
```Shell
994+
995+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# systemctl status firewalld
996+
```
997+
974998
5. 设置是否开机自启。
975999
1000+
```Shell
1001+
1002+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# systemctl enable firewalld
1003+
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
1004+
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
1005+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# systemctl disable firewalld
1006+
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
1007+
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
1008+
```
1009+
9761010
### 计划任务
9771011
9781012
1. **crontab**命令。
@@ -989,44 +1023,89 @@ build environment:
9891023
9901024
```Shell
9911025
992-
1026+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# ifconfig eth0
1027+
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
1028+
inet 172.18.61.250 netmask 255.255.240.0 broadcast 172.18.63.255
1029+
ether 00:16:3e:02:b6:46 txqueuelen 1000 (Ethernet)
1030+
RX packets 1067841 bytes 1296732947 (1.2 GiB)
1031+
RX errors 0 dropped 0 overruns 0 frame 0
1032+
TX packets 409912 bytes 43569163 (41.5 MiB)
1033+
TX errors 0 dropped 0 overruns 0 carrier 0 collisions
9931034
```
9941035
9951036
3. 显示/操作网络配置(新) - **ip**。
9961037
9971038
```Shell
9981039
999-
1040+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# ip address
1041+
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
1042+
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
1043+
inet 127.0.0.1/8 scope host lo
1044+
valid_lft forever preferred_lft forever
1045+
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
1046+
link/ether 00:16:3e:02:b6:46 brd ff:ff:ff:ff:ff:ff
1047+
inet 172.18.61.250/20 brd 172.18.63.255 scope global eth0
1048+
valid_lft forever preferred_lft forever
10001049
```
10011050
10021051
4. 网络可达性检查 - **ping**。
10031052
10041053
```Shell
10051054
1006-
1055+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# ping www.baidu.com -c 3
1056+
PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.
1057+
64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=1 ttl=51 time=36.3 ms
1058+
64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=2 ttl=51 time=36.4 ms
1059+
64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=3 ttl=51 time=36.4 ms
1060+
--- www.a.shifen.com ping statistics ---
1061+
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
1062+
rtt min/avg/max/mdev = 36.392/36.406/36.427/0.156 ms
10071063
```
10081064
10091065
5. 查看网络服务和端口 - **netstat**。
10101066
10111067
```Shell
10121068
1013-
1069+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# netstat -nap | grep nginx
10141070
```
10151071
10161072
6. 安全文件拷贝 - **scp**。
10171073
10181074
```Shell
10191075
1020-
1076+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# scp [email protected]:/root/guido.jpg [email protected]:/home/hellokitty/pic.jpg
10211077
```
10221078
10231079
7. 安全文件传输 - **sftp**。
10241080
10251081
```Shell
10261082
1027-
1083+
[root@iZwz97tbgo9lkabnat2lo8Z ~]# sftp [email protected]
1084+
[email protected]'s password:
1085+
Connected to 120.77.222.217.
1086+
sftp>
10281087
```
10291088

1089+
- `help`:显示帮助信息。
1090+
1091+
- `ls`/`lls`:显示远端/本地目录列表。
1092+
1093+
- `cd`/`lcd`:切换远端/本地路径。
1094+
1095+
- `mkdir`/`lmkdir`:创建远端/本地目录。
1096+
1097+
- `pwd`/`lpwd`:显示远端/本地当前工作目录。
1098+
1099+
- `get`:下载文件。
1100+
1101+
- `put`:上传文件。
1102+
1103+
- `rm`:删除远端文件。
1104+
1105+
- `bye`/`exit`/`quit`:退出sftp。
1106+
1107+
1108+
10301109
### Shell和Shell编程
10311110

10321111
1. 通配符。

0 commit comments

Comments
 (0)