轩尼诗是什么酒| 吃什么补白蛋白最快| 什么值得买怎么用| 什么是果糖| 拉稀肚子疼吃什么药| 涵养是什么意思| 肝脾肿大是什么症状| 乘风破浪的意思是什么| 李子吃多了有什么坏处| 补肾吃什么药效果最好| 女性尿急憋不住尿是什么原因| 清华校长什么级别| 处女座男生喜欢什么样的女生| 经期不能吃什么水果| 贪是什么意思| 拿什么爱你| 棉絮是什么意思| 血液四项检查是什么| 胰腺炎吃什么消炎药| 血糖偏低是什么原因引起的| 鸽子炖什么| 01年属什么| 迄今为止什么意思| 六味地黄丸是治什么的| 男人尿道炎吃什么药最好| 温存是什么意思| 尿酸高喝什么茶| 电商属于什么行业| 儿童咳嗽吃什么药| 做梦来月经了什么预兆| 登革热是什么症状| 空心是什么意思| 什么的心情| 1210是什么星座| 家里放什么最招财| 蚊子最怕什么| 舌头胖大是什么原因| 小孩头发黄是什么原因| 喝什么茶养肝护肝| 闺房是什么意思| 一边脸大一边脸小是什么原因| 九寨沟什么时候去最好| 桥本氏甲状腺炎是什么意思| 丝状疣用什么药| 经常抠鼻子有什么危害| 发烧时不宜喝什么饮料| 什么是舒张压和收缩压| 看胃挂什么科室| 苦海无涯回头是岸是什么意思| 早上头晕是什么原因| 为什么会长荨麻疹| 子痫是什么意思| 上升星座是什么意思| 化疗后骨髓抑制是什么意思| 胸闷气短是什么病| 蛇胆疮是什么引起的| 自闭症是什么原因引起| 下巴痘痘反复长是什么原因| 熬夜为什么会胖| 2026是什么年| 盐糖水有什么功效作用| 吃鱼有什么好处| 小女子这厢有礼了什么意思| 桉是什么意思| 导诊是干什么的| 为什么拉绿色的屎| skirt什么意思| 神经内科看什么病| 克罗心是什么意思| 梦到被雷劈是什么意思| 太阳出来我爬山坡是什么歌| 一什么黑暗| 红楼梦是一部什么小说| 智齿是什么| 阁老相当于现在什么官| 梦见两个小男孩是什么意思| 男生被口什么感觉| 斑秃吃什么药| 肠胃炎适合吃什么食物| 小螃蟹吃什么食物| 血氨低是什么原因| 空调干燥是什么意思| 金鸡报晓是什么意思| 有什么故事| 男人吃什么壮阳最快| 五味子不适合什么人喝| suki什么意思| 河蚌用什么呼吸| 老年人便秘吃什么药| 乳房检查挂什么科| 什么清什么秀| 为什么姓张的不用说免贵| be结局是什么意思| 食禄痣是什么意思| 没事找事是什么意思| 帕金森是什么病| 女生排卵期在什么时候| 严重失眠吃什么药管用| 宁夏古代叫什么| 武汉有什么好玩的地方| 舌面上有裂纹是什么病| 为什么要小心AB型血的人| 一九六三年属什么生肖| 香菇不能和什么一起吃| 罗姓男孩取什么名字好| 什么叫撤退性出血| 照是什么意思| 焦糖色搭配什么颜色好看| 三无是什么意思| 辣椒什么时候种| 纨绔子弟是什么意思| 在下是什么意思| 盐酸舍曲林片治疗什么程度的抑郁| 吃毛蛋有什么好处| 情不自禁的禁是什么意思| 回锅肉是什么肉| 牙齿发黄是什么原因导致的| 吃人肉会得什么病| 空亡是什么意思| 全组副鼻窦炎什么意思| 大姨妈为什么会推迟| 转氨酶异常有什么症状| 投递是什么意思| 英雄是什么生肖| 心里紧张吃什么药缓解| 解酒吃什么水果| 霞字五行属什么| 梦见自己把蛇打死了是什么意思| 颈椎病用什么药| 崇洋媚外是什么意思| 高尿酸血症是什么病| 梦见桥断了是什么意思| 小混混是什么意思| 左旋肉碱什么时候吃| 菡字五行属什么| 偏头痛看什么科| 手脚出汗多是什么原因| 额头反复长痘是什么原因| 小孩手指头脱皮是什么原因| 小儿发烧吃什么食物好| 印度什么时候独立的| 胃疼吃什么食物对胃好| 4月3号是什么星座| 吃得什么| 小孩睡觉说梦话是什么原因| 1994年属狗是什么命| 12月13日是什么纪念日| 爸爸的姥姥叫什么| 农历10月14日是什么星座| 脑癌是什么原因引起的| 9月25是什么星座| saq是什么意思| 午时银花露有什么功效| 芊字五行属什么| 湿热喝什么茶可以调理| 后循环缺血吃什么药| 土家族是什么族| 山见念什么| 吃什么药降尿酸快| 足跟痛挂什么科| 头痒用什么东西洗头最好| 八格牙路是什么意思| luxury是什么牌子| 股骨头坏死吃什么药| 高铁列车长是什么级别| 4月8日什么星座| 龋齿是什么原因造成的| 什么是白肉| 贫血的人适合喝什么茶| 尿检红细胞高是什么原因| 喉炎吃什么药好得快| 甲母痣是什么| 猫代表什么象征意义| 多多益善是什么意思| 咂是什么意思| 负氧离子是什么| 双头蛇是什么意思| 眼球突出是什么原因| 相招是什么意思| 婴儿拉奶瓣是什么原因| petct是什么| 腼腆是什么意思| 费气肿要吃什么药| 七八年属什么生肖| 三点水一个兆读什么| 肾和性功能有什么关系| 玻璃的原材料是什么| 双鱼和什么星座最配对| 吃钙片有什么副作用| 伤口好转的迹象是什么| 甘薯是什么东西| 均为是什么意思| 奥美拉唑是治什么病的| 螃蟹的什么部位不能吃| 风花雪月是什么生肖| 长颈鹿代表什么生肖| 天才是什么意思| 身上长癣是什么原因| 毒龙什么意思| 京东plus是什么意思| 一号来的月经排卵期是什么时候| 云字属于五行属什么| 把子肉是什么肉| 补充公积金是什么意思| 唐筛和无创有什么区别| 师团长是什么级别| 圆明园是什么时候被烧的| 睡觉小腿抽筋是什么原因| 痛风什么引起的原因有哪些| 肚子突然变大是什么原因| 控销药品什么意思| emoji什么意思| 什么是辛辣食物| 考试穿什么颜色的衣服| 什么克风| 打边炉是什么| 乳糖不耐受可以喝什么奶| 锋芒毕露什么意思| 话题是什么意思| 舌头两侧溃疡吃什么药| 腰间盘突出吃什么| 灰指甲有什么症状| 攥是什么意思| 容五行属什么| 正厅级是什么级别| 6月20号是什么星座| 做阴超有黄体说明什么| 什么是2B铅笔| 请问今晚买什么生肖| 心电图能检查出什么病| 哺乳期吃什么下奶| 白里透红的透是什么意思| 1994年什么命| ml是什么单位| 量贩装是什么意思| cl是什么牌子| 吐血拉血是什么病的症状| 宫颈多发囊肿是什么意思| 说梦话是什么原因引起的| 自提是什么意思| 头疼恶心是什么症状| 吃饭不规律会导致什么问题| 妃是什么意思| 马拉色菌毛囊炎用什么药治疗最好| 贾宝玉大名叫什么| 西双版纳有什么好玩的地方| 蛰居是什么意思| 饭圈是什么意思| 马拉松pb是什么意思| 喝什么茶可以降尿酸| 苦瓜泡水喝有什么功效| 凯撒沙拉酱是什么口味| 哺乳期感冒能吃什么药| 肠炎挂什么科| 1点到3点是什么时辰| 帅是什么意思| 玻璃水是什么| 过敏性鼻炎用什么药最好| 宝齐莱算什么档次的表| 黑色的蜜蜂是什么蜂| 1956年是什么年| pe是什么意思| 最好的减肥方法是什么| 百合什么时候种植最好| 百度

秦咸阳城遗址发现罕见战国晚期卜甲(1)

百度 身高米,体态偏瘦,方脸,寸发近乎光头,左胸口有狼头纹身。

In computing, netstat is a command-line network utility that displays open network sockets, routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics. It is available on Unix, Plan 9, Inferno, and Unix-like operating systems including macOS, Linux, Solaris and BSD. It is also available on IBM OS/2 and on Microsoft Windows NT-based operating systems including Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10.

netstat
Developer(s)Various open-source and commercial developers
Initial release1983; 42 years ago (1983)
Written inPlan 9: C
Operating systemUnix, Unix-like, Plan 9, Inferno, OS/2, Microsoft Windows, ReactOS
PlatformCross-platform
TypeCommand
LicenseOS/2, Windows: Proprietary commercial software
net-tools, ReactOS: GPLv2
Plan 9: MIT License

It is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement.[1] On Linux this program is mostly obsolete, although still included in many distributions.

On Linux, netstat (part of "net-tools") is superseded by ss (part of iproute2). The replacement for netstat -r is ip route, the replacement for netstat -i is ip -s link, and the replacement for netstat -g is ip maddr, all of which are recommended instead.[2][3][4][5]

Statistics provided

edit

Netstat provides statistics for the following:

  • Proto – The name of the protocol (TCP, UDP, etc.). On some systems, the protocol name may be followed by "4" or "6", depending on whether the protocol is running over IPv4 or IPv6.
  • Local Address – The IP address of the local computer and the port number being used. The name of the local computer that corresponds to the IP address and the name of the port is shown unless the -n parameter is specified. An asterisk (*) is shown for the host if the server is listening on all interfaces. If the port is not yet established, the port number is shown as an asterisk.
  • Foreign Address – The IP address and port number of the remote computer to which the socket is connected. The names that corresponds to the IP address and the port are shown unless the -n parameter is specified. If the port is not yet established, the port number is shown as an asterisk (*).
  • State – Indicates the state of a TCP connection. The possible states are as follows: CLOSE_WAIT, CLOSED, ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, LAST_ACK, LISTEN, SYN_RECEIVED, SYN_SEND, and TIME_WAIT. For more information about the states of a TCP connection, see RFC 793.

Parameters

edit

Parameters used with this command must be prefixed with a hyphen (-) rather than a slash (/). Some parameters are not supported on all platforms.

Name Description Windows ReactOS macOS BSD NetBSD FreeBSD Linux Solaris OS/2
-a Displays all active connections and the TCP and UDP ports on which the computer is listening. Yes Yes Yes Yes Yes Yes
-b Displays the binary (executable) program's name involved in creating each connection or listening port. (Windows XP, Windows Server 2003 and newer Windows operating systems; not Microsoft Windows 2000 or older). Yes No No
-b Causes -i to report the total number of bytes of traffic. No Yes Yes No
-e Displays ethernet statistics, such as the number of bytes and packets sent and received. This parameter can be combined with -s. Yes Yes No
-f Displays fully qualified domain names <FQDN> for foreign addresses (only available on Windows Vista and newer operating systems). Yes No No
-f Address Family Limits display to a particular socket address family, unix, inet, inet6 No Yes No
-g Displays multicast group membership information for both IPv4 and IPv6 (may only be available on newer operating systems) No No Yes
-i Displays network interfaces and their statistics No No Yes Yes Yes Yes Yes
-m Displays the memory statistics for the networking code (STREAMS statistics on Solaris). No No Yes Yes Yes Yes Yes
-n Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names. Yes Yes Yes Yes Yes Yes Yes Yes
-o Displays active TCP connections and includes the process id (PID) for each connection. You can find the application based on the PID in the Processes tab in Windows Task Manager. This parameter can be combined with -a, -n, and -p. This parameter is available on Microsoft Windows XP, Windows Server 2003, and Windows 2000 if a hotfix is applied.[6] Yes No No
-p protocol Shows connections for the protocol specified by protocol. In this case, protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6. Yes Yes Yes Yes Yes Yes
-p Show which processes are using which sockets (similar to -b under Windows) (you must be root to do this) No No Yes
-P protocol Shows connections for the protocol specified by protocol. In this case, protocol can be ip, ipv6, icmp, icmpv6, igmp, udp, tcp, or rawip. No No Yes
-r Displays the contents of the IP routing table. (This is equivalent to the route print command under Windows.) Yes Yes Yes Yes Yes Yes Yes Yes Yes
-s Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols. If the IPv6 protocol for Windows XP is installed, statistics are shown for the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols. Yes Yes Yes Yes Yes Yes Yes Yes
-t Display only TCP connections. No Yes Yes
-u Display only UDP connections. No No Yes Yes
-W Display wide output - doesn't truncate hostnames or IPv6 addresses No No Yes No
-x Displays NetworkDirect connections, listeners, and shared endpoints. Yes
-y Displays the TCP connection template for all connections.Cannot be combined with the other options. Yes
-v When used in conjunction with -b it will display the sequence of components involved in creating the connection or listening port for all executables. Yes No No
Interval Redisplays the selected information every Interval seconds. Press CTRL+C to stop the redisplay. If this parameter is omitted, netstat prints the selected information only once. Yes Yes No
-h Displays help at the command prompt. Yes No Yes Yes Yes Yes Yes Yes No
-? Displays help at the command prompt. Yes No No No No No No No Yes
/? Displays help at the command prompt. Yes Yes No No No No No No No

Examples

edit

Cross platform

edit

On macOS, BSD systems, Linux distributions, and Microsoft Windows:

To display the statistics for only the TCP or UDP protocols, type one of the following commands:

netstat -sp tcp

netstat -sp udp

Unix-like

edit

On Unix-like systems:

To display all ports open by a process with id pid:

netstat -aop | grep "pid"

To continuously display open TCP and UDP connections numerically and also which program is using them on Linux:

netstat -nutpacw

Windows

edit

On Microsoft Windows:

To display active TCP connections and the process IDs every 5 seconds, type the following command (works on NT based systems only, or Windows 2000 with hotfix):

netstat -o 5

To display active TCP connections and the process IDs using numerical form, type the following command (works on NT based systems only, or Windows 2000 with hotfix):

netstat -no

*nix

edit
Command Explanation
netstat -a Shows all sockets, both listening and non-listening, all protocols like TCP, UDP etc.
netstat -at Shows only TCP connections (-au shows only UDP connections)
netstat -ant Shows all TCP connections with no DNS resolution (show IP addresses instead).
netstat -al Shows only listening sockets.
netstat -aep Also show PID and to which program each socket belongs, e adds extra info like the user. Run as root to see all PIDs.
netstat -s Shows network statistics.
netstat -r Shows kernel routing information. This is the same output as route -e.
netstat -i Displays a table of all network interfaces. Add -e to get output similar to ifconfig.
netstat -ct Displays TCP connections continuously.
netstat -g Display multicast group membership information for IPv4 and IPv6.
netstat -lntu Display all services listening for TCP and UDP, all free open ports on the local machine.
netstat -atnp | grep ESTA Displays all currently "established" TCP connections.

Wildcards

edit

Netstat uses an asterisk * as a wildcard which means "any". An example would be

Example output:

....Local Address Foreign Address State
... *:smtp          *:*   LISTEN

Under "Local Address" *, in *:smtp, means the process is listening on all of the network interfaces the machine has for the port mapped as smtp (see /etc/services for service resolution). This can also be shown as 0.0.0.0. The first *, in *:*, means connections can come from any IP address, and the second *, in *:*, means the connection can originate from any port on the remote machine.

Caveats

edit

Some versions of netstat lack explicit field delimiters in their printf-generated output, leading to numeric fields running together and thus corrupting the output data.

Platform specific remarks

edit
 
The ReactOS netstat command
 
The macOS netstat command

Under Linux, raw data can often be obtained from the /proc/net/dev to work around the printf output corruption arising in netstat's network interface statistics summary, netstat -i, until such time as the problem is corrected.[citation needed]

On the Windows platform, netstat information can be retrieved by calling the GetTcpTable and GetUdpTable functions in the IP Helper API, or IPHLPAPI.DLL. Information returned includes local and remote IP addresses, local and remote ports, and (for GetTcpTable) TCP status codes. In addition to the command-line netstat.exe tool that ships with Windows, GUI-based netstat programs are available.

On the Windows platform, this command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.

On the Windows platform running Remote Desktop Services (formerly Terminal Services) it will only show connections for the current user, not for the whole computer.

On macOS, the /System/Library/CoreServices/Applications folder (or /Applications/Utilities in OS X Mountain Lion and earlier) contains a network GUI utility called Network Utility, the Netstat tab of which runs the netstat command and displays its output in the tab.

See also

edit

References

edit
  1. ^ "IBM Systems Information Center". ibm.com. 8 May 2007.
  2. ^ "net-tools". linuxfoundation.org. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  3. ^ "Arch Linux". archlinux.org. 8 June 2011.
  4. ^ "Deprecated Linux networking commands and their replacements". Doug Vitale Tech Blog. 21 December 2011.
  5. ^ "netstat man page (notes section)". Retrieved 2 August 2014. This program is obsolete. Replacement for netstat is ss. Replacement for netstat -r is ip route. Replacement for netstat -i is ip -s link. Replacement for netstat -g is ip maddr.
  6. ^ "The netstat command can now display process IDs that correspond to active TCP or UDP connections in Windows 2000". Archived from the original on 24 August 2007.

Further reading

edit
edit
无氧运动是什么 什么是腺样体面容 七月八号是什么星座 羊是什么命 中暑什么症状表现
阴超可以检查出什么 三天没有大便是什么原因 壁厚是什么意思 98属什么 无花果什么时候结果
今天忌什么宜什么 莲花和荷花有什么区别 凌晨的凌是什么意思 碧螺春属于什么茶类 肠胃炎饮食要注意什么
佝偻病缺少什么元素 出院小结是什么 用什么泡脚能减肥 烧仙草是什么植物 sansui是什么牌子
什么星hcv8jop1ns2r.cn 土豆有什么营养hcv9jop3ns0r.cn 一个月一个泉是什么字hcv8jop6ns4r.cn 喝黑枸杞有什么作用和功效hcv9jop2ns5r.cn 偏科是什么意思hcv8jop4ns5r.cn
出汗发粘是什么原因hcv9jop4ns2r.cn 煞北是什么意思1949doufunao.com 12月20日是什么星座hcv7jop9ns2r.cn 猫摇尾巴是什么意思hcv9jop6ns0r.cn 宫颈囊肿有什么症状表现mmeoe.com
炙什么意思hcv9jop3ns2r.cn 淋巴细胞偏高说明什么问题hcv8jop1ns9r.cn p代表什么hcv9jop7ns9r.cn 视力矫正是什么意思hcv9jop2ns0r.cn 淋巴结是什么hcv8jop3ns6r.cn
什么看果园越看越少hcv8jop0ns3r.cn 眼睛突然红了是什么原因hcv9jop0ns5r.cn 麻疹是什么hcv8jop7ns9r.cn 边沿是什么意思hcv8jop8ns1r.cn 催乳素是什么意思hcv9jop2ns7r.cn
百度