Linux 常用命令
查看磁盘大小
df -hl
df -h
du -sh [目录名]
du -sm [目录名]
du -h [目录名]
df --help
du --help
netstat
yum install -y net-tools
netstat -nap | grep 进程pid
netstat -tunlp | grep 端口号
lsof
yum install -y lsof
lsof -i:8080
lsof abc.txt
lsof -c abc
lsof -c -p 1234
lsof -g gid
lsof +d /usr/local/
lsof +D /usr/local/
lsof -d 4
lsof -i -U
firewall 防火墙
systemctl start firewalld.service
systemctl enable firewalld.service
systemctl stop firewalld.service
firewall-cmd --state
iptables -nL
firewall-cmd --zone=public --list-ports
firewall-cmd --reload
firewall-cmd --permanent --zone=public --add-port=81/tcp
firewall-cmd --permanent --zone=public --add-port=8080-8083/tcp
firewall-cmd --permanent --zone=public --remove-port=81/tcp
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="6379" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.0.233" accept"
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.1.51" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.0.0/16" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.1.0/24" port protocol="tcp" port="9200" accept"
firewall-cmd --reload