Linux常用命令

查看系统信息

查看系统信息

查看资源占用情况

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

安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值