-
-
Save yeetim/b1ffdb0cf0cb5c1bf33a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#查看当前TCP链接状态 | |
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}' | |
#CLOSED: 无连接是活动的或正在进行 | |
#LISTEN: 服务器在等待进入呼叫 | |
#SYN_RECV: 一个连接请求已经到达,等待确认 | |
#SYN_SENT: 应用已经开始,打开一个连接 | |
#ESTABLISHED:正常数据传输状态 | |
#FIN_WAIT1: 应用说它已经完成 | |
#FIN_WAIT2: 另一边已同意释放 | |
#ITMED_WAIT: 等待所有分组死掉 | |
#CLOSING: 两边同时尝试关闭 | |
#TIME_WAIT: 另一边已初始化一个释放 | |
#LAST_ACK: 等待所有分组死掉 | |
#查看连接某服务端口最多的的IP地址 | |
netstat -nat | grep "ip:port" |awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -20 | |
# | |
netstat -nat |awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -20 | |
#mysql add user | |
grant all[权限] on 数据库.* to 用户名@登录主机 identified by '' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment