Linux命令netstat解读
生活随笔
收集整理的這篇文章主要介紹了
Linux命令netstat解读
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Netstat命令用于顯示與IP、TCP、UDP和ICMP協議相關的統計數據,一般用于檢驗本機各端口的網絡連接情況。
常用命令:
?在Internet RFC標準中,Netstat的定義是: Netstat是在內核中訪問網絡及相關信息的程序,它能提供TCP連接,TCP和UDP監聽,進程內存管理的相關報告。
# netstat --help usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}netstat [-vnNcaeol] [<Socket> ...]netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]-r, --route display routing table-I, --interfaces=<Iface> display interface table for <Iface>-i, --interfaces display interface table-g, --groups display multicast group memberships-s, --statistics display networking statistics (like SNMP)-M, --masquerade display masqueraded connections-v, --verbose be verbose-n, --numeric don't resolve names--numeric-hosts don't resolve host names--numeric-ports don't resolve port names--numeric-users don't resolve user names-N, --symbolic resolve hardware names-e, --extend display other/more information-p, --programs display PID/Program name for sockets-c, --continuous continuous listing-l, --listening display listening server sockets-a, --all, --listening display all sockets (default: connected)-o, --timers display timers-F, --fib display Forwarding Information Base (default)-C, --cache display routing cache instead of FIB-T, --notrim stop trimming long addresses-Z, --context display SELinux security context for sockets<Iface>: Name of interface to monitor/list.<Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom<AF>=Use '-A <af>' or '--<af>'; default: inetList of possible address families (which support routing):inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25)常用命令:
# netstat -an |grep 8080 ?:查找8080端口
#netstat -s?:按照各個協議分別顯示其統計數據。
#?netstat -r?:顯示關于路由表的信息。
#netstat -a?:顯示一個所有的有效連接信息列表。
#netstat -n?: 顯示所有已建立的有效連接。
#netstat -at:顯示tcp或udp協議的鏈接
#netstat -tnl:列出監聽端口
#netstat -ant:禁用反向域名解析
#netstat -nlpt:獲取進程名、進程號以及用戶 ID
總結
以上是生活随笔為你收集整理的Linux命令netstat解读的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java的char数据类型存储一个中文字
- 下一篇: Java之String、StringBu