查看系统信息
查看系统信息
查看资源占用情况
top
参考:top命令参数详解 - Tester_Jhm - 博客园
查看日志
tail -f -n 400 xxx.log
网络
查看连接数
netstat -an
查看对应端口连接数
netstat -nat|grep -i "80"|wc -l
参考链接:Linux查看网络连接数,统计网络连接数(netstat、Apache连接数)_墨痕诉清风的博客-CSDN博客_linux查看连接数
防火墙
firewall
查看状态
service firewalld status
开启
service firewalld start
重启
service firewalld restart
关闭
service firewalld stop
开放8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
关闭5672端口
firewall-cmd --zone=public --remove-port=5672/tcp --permanent
查看防火墙所有开放的端口
firewall-cmd --zone=public --list-ports
配置立即生效
firewall-cmd --reload
iptables防火墙设置
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT #开启80端口
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT #开启22端口
/etc/rc.d/init.d/iptables save #保存配置
/etc/rc.d/init.d/iptables restart #重启服务
查看已开放端口
/etc/init.d/iptables status
结果如下
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
构建http请求
application/json
curl localhost:3000/api/basic -X POST -d '{"hello": "world"}' -H "Content-Type: application/json""
多个请求头使用多个-H标签
application/x-www-form-urlencoded
curl localhost:3000/api/basic -X POST -d 'hello=world'
multipart/form-data
curl localhost:3000/api/multipart -F raw=@raw.data -F hello=world
‘@’ 后跟文件名称
工具
解压缩工具
解压tar.gz
tar -zxvf archive.tar.gz -C /usr/local/jdk