Linux常用命令
常用命令如下:
#nginx重启 nginx -s reload #查看启用端口 netstat -tuln #防火墙关闭 systemctl stop firewalld #防火墙开启 systemctl start firewalld #防火墙刷新配置 firewall-cmd --reload #防火墙开放80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent #查看文件最后100行 tail -n 100 test.txt #查看系统最大打开文件数 ulimit -n #查看指定pid下的打开的文件数 lsof -p pid |wc -l #查看系统当前打开的文件数 lsof -Ki|wc -l #查看打开文件数最多的6个进程(第一列是数列,第二列是进程id) lsof -Ki|awk '{print $2}'|sort|uniq -c|sort -n -r|head -6 #路由跟踪 tracert -d -w 2 192.168.168.200 #重新获取IP ipconfig /renew #查看IP的DNS nslookup 192.168.168.200 nslookup ymtng.whsybj.cn 10.88.58.58 #检测远程主机TCP端口开启状态(先安装nc:yum install nc -y) nc -uz 127.0.0.1 80 #检测远程主机UPD端口开启状态 nc -zvu 127.0.0.1 500 #windows端口转发 netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=80 connectaddress=127.0.0.1 connectport=8080 #删除指定端口转发 netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=80 #删除全部端口转发 netsh interface portproxy reset #显示全部端口转发 netsh interface portproxy show all
正在加载评论...