diff ss and netstat and lsof
关于如何试用ss,netstat, lsof 命令在日常运维中.
个人看法不需要记住所有用法,记住最常用组合+参数意思
ss -tlnp
ss | head -n 5
ss -tn -o
ss -nt dst :443 or dst :80
ss -t4 state established
ss -t4 state listening
watch -n 1 "ss -t4 state established”
-o show live time
Netstat - tlnp | grep port/pid
Netstat -at #display all tcp
-a all
lsof -i :8909
lsof -p pid #show pid opened files
-t tcp
-l listening
-n show ip only, don’t resolve hostname
-p program