Liunx常用命令:
https://www.runoob.com/w3cnote/linux-common-command-2.html
Liunx命令大全
Cup、内存、磁盘空间
top
free -h
df –h
fdisk –l
端口监控:
netstat -nat|grep ESTABLISHED|wc -l
netstat -nat|grep -i ":80" | grep EST |wc -l
netstat -ano | find "95.87:80" | find "EST" /c
进程:
ps –ef | grep java
线程数:
ps -eLf | wc -l
ps -eLf | grep java | wc –l
tar
解包:tar zxvf filename.tar
打包:tar czvf filename.tar dirname
zip命令
解压:unzip filename.zip
压缩:zip filename.zip dirname
防护墙:
vi /etc/sysconfig/iptables
重启防火墙:service iptables restart
查看状态:service iptables status
关闭防火墙:service iptables stop
防护墙(新):
查看所有打开的端口:
firewall-cmd --zone=public --list-ports
添加端口:
firewall-cmd --zone=public --add-port=80/tcp --permanent
更新防火墙规则:
firewall-cmd --reload
查状态:
systemctl status firewalld
文件查看:
tail –f xxx.log
tail –n 100 xxx.log
scp :
参考:https://www.runoob.com/linux/linux-comm-scp.html
样例:scp /opt/intf/test.jar root@192.168.0.11:/opt/intf
RPM命令:
rpm -ivh your-package # 直接安装
rpm -ql tree #
查询
rpm -e tree #
卸载