-
Notifications
You must be signed in to change notification settings - Fork 14
/
CentOSTips.md
98 lines (81 loc) · 1.92 KB
/
CentOSTips.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# CentOS Tips
```sh
yum list installed | grep gcc
yum list installed | grep lrzsz
```
## lrzsz
- [lrzsz官网](http://freshmeat.sourceforge.net/projects/lrzsz/)
- `yum -y install lrzsz`
- `sz /home/shelldir/*.sh`:下载目录
### 离线安装
[lrzsz-0.12.20.tar.gz](https://ohse.de/uwe/software/lrzsz.html)
```sh
mkdir -p ~/tool/lrzsz/
mv lrzsz-0.12.20.tar.gz ~/tool/lrzsz/
cd ~/tool/lrzsz/
tar -zxvf lrzsz-0.12.20.tar.gz
cd lrzsz-0.12.20
./configure --prefix=~/tool/lrzsz/
make && make install
```
```sh
cd ~/tool/lrzsz/bin
ln -s lsz sz
ln -s lrz rz
#修改环境变量,在~/.bashrc文件末尾加入export PATH="~/tool/lrzsz/bin:$PATH"
vi ~/.bashrc
source ~/.bashrc
```
## iptables
- 暂时关闭/打开
- `service iptables stop`
- `service iptables start`
- 永久打开/关闭
- `chkconfig iptables on`
- `chkconfig iptables off`
- 验证
- `chkconfig --list | grep iptables`
## network
- `service network restart`
## ntpdate
- `yum -y install ntp ntpdate`
- `vim /etc/rc.d/rc.local`
- `/usr/sbin/ntpdate cn.pool.ntp.org`
## telnet
- `yum install telnet`
## zip
- `yum -y install zip`
## Commands
### bc
- `scale=2`
## sar
- `yum install sysstat`
## mail
- `yum -y install mailx`
- `yum install sendmail`
## vim
- `yum -y install vim*`
## sudo
```
sudo visudo
sysadmin ALL=(ALL) NOPASSWD:ALL
```
## git
```sh
sudo yum -y install git
git --version
git config --global user.name "T5750"
git config --global user.email "you@example.com"
git config --list
```
## AppStream
```sh
cd /etc/yum.repos.d
sudo mkdir backup
sudo mv *.repo backup/
sudo curl -o /etc/yum.repos.d/Centos-vault-8.5.2111.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache
```
## References
- [Centos8 yum安装报错Error: Failed to download metadata for repo ‘AppStream‘](https://www.cnblogs.com/Fengdengshuai/p/15988606.html)
- [lrzsz离线安装方法](https://www.cnblogs.com/lcgbk/p/14848852.html)