首页 > 系统相关 >netstat

netstat

时间:2023-05-10 19:13:48浏览次数:51  
标签:statistics netstat TCP connections connection Displays

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-t] [-x] [-y] [interval]

  -a            Displays all connections and listening ports.
  -b            Displays the executable involved in creating each connection or
                listening port. In some cases well-known executables host
                multiple independent components, and in these cases the
                sequence of components involved in creating the connection
                or listening port is displayed. In this case the executable
                name is in [] at the bottom, on top is the component it called,
                and so forth until TCP/IP was reached. Note that this option
                can be time-consuming and will fail unless you have sufficient
                permissions.
  -e            Displays Ethernet statistics. This may be combined with the -s
                option.
  -f            Displays Fully Qualified Domain Names (FQDN) for foreign
                addresses.
  -n            Displays addresses and port numbers in numerical form.
  -o            Displays the owning process ID associated with each connection.
  -p proto      Shows connections for the protocol specified by proto; proto
                may be any of: TCP, UDP, TCPv6, or UDPv6.  If used with the -s
                option to display per-protocol statistics, proto may be any of:
                IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
  -q            Displays all connections, listening ports, and bound
                nonlistening TCP ports. Bound nonlistening ports may or may not
                be associated with an active connection.
  -r            Displays the routing table.
  -s            Displays per-protocol statistics.  By default, statistics are
                shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;
                the -p option may be used to specify a subset of the default.
  -t            Displays the current connection offload state.
  -x            Displays NetworkDirect connections, listeners, and shared
                endpoints.
  -y            Displays the TCP connection template for all connections.
                Cannot be combined with the other options.
  interval      Redisplays selected statistics, pausing interval seconds
                between each display.  Press CTRL+C to stop redisplaying
                statistics.  If omitted, netstat will print the current
                configuration information once.

loop

netstat -abo 1

In cmd:

netstat -na | find "8080"

In bash:

netstat -na | grep "8080"

In PowerShell:

netstat -na | Select-String "8080"
taskkill /F /pid

https://stackoverflow.com/questions/12010631/command-line-for-looking-at-specific-port

标签:statistics,netstat,TCP,connections,connection,Displays
From: https://www.cnblogs.com/Searchor/p/17389029.html

相关文章

  • netstat命令端口状态
    TCP协议规定,对于已经建立的连接,网络双方要进行四次握手才能成功断开连接,如果缺少了其中某个步骤,将会使连接处于假死状态,连接本身占用的资源不会被释放。网络服务器程序要同时管理大量连接,所以很有必要保证无用连接完全断开,否则大量僵死的连接会浪费许多服务器资源。在众多TCP状态......
  • Netstat 备忘清单_开发速查表分享
    Netstat备忘清单netstat命令是一个命令行工具,可以在Windows、Linux、MacOSX等操作系统中使用,它可以帮助用户查看本地主机的网络连接情况。它可以报告出本地主机的TCP/IP协议统计信息,包括活动的TCP连接,UDP端口,所有的接口信息,以及活动的网络连接等。netstat命令可以用来查看本......
  • Linux netstat命令详解
    Netstat是一款命令行工具,可用于列出系统上所有的网络套接字连接情况,包括tcp,udp以及unix套接字,另外它还能列出处于监听状态(即等待接入请求)的套接字。如果你想确认系统上的Web服务有没有起来,你可以查看80端口有没有打开。以上功能使netstat成为网管和系统管理员的必备利器......
  • Linux 命令 | netstat
    netstat通常用来检查各端口的网络连接情况。可以显示IP、TCP、UDP、ICMP协议相关数据。最常用方式netstat-tlunp,显示结果如下:第二行的列名说明了每一列的内容......
  • linux 命令使用9--netstat(网络)
    1.概述netstat命令是一个监控TCP/IP网络的非常有用的工具,它可以显示路由表、实际的网络连接以及每一个网络接口设备的状态信息。2.语法netstat[-acCeFghilMnNoprstuvV......
  • linux 网络管理之netstat命令详解
    一、Netstat的作用netstat用于显示网络状态,可以查看服务器当前端口列表及指定端口的连接状态二、语法格式[root@host127home]#netstat-husage:netstat[-vWeenNcCF......
  • windows端口占用netstat查找无占用
    1、问题在软件,idea项目启动中,端口显示被占用,但是使用:netstat-aon|findstr1099显示出端口并没有被占用:网络上查询很多都显示是Hyper-V会保留端口。而你如果在Wind......
  • linux lsof/netstat查看进程和端口号相关命令:
    本文为博主原创,未经允许不得转载:      在linux操作时,经常要查看运行的项目的进程和端口号,在这里总结了以下常用到的相关命令:      1.查看系统运行的java项目,......
  • netstat 最常用的几个用法
    查看本机的所有TCP/IP和UDP端口信息:netstat-atun查看详细的TCP/IP状态:netstat-s查看TCP/IP统计信息:netstat-i查看本机开放的端口:netstat-an查看详细的网......
  • linux监控命令netstat
    netstat常用参数说明:-a:列出所有的连接状态,包括tcp/udp/unixsocket等-t:仅列出TCP封包的连接-u:仅列出UDP封包的连接-l:仅列出有在Listen(监听)的服务的网络状态......