0% found this document useful (0 votes)
18 views4 pages

NETSTA

Uploaded by

Art Attack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

NETSTA

Uploaded by

Art Attack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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

Shows all sockets, both listening and non-listening, all protocols like
netstat -a
TCP, UDP etc.

netstat -at Shows only TCP connections (-au shows only UDP connections)

Shows all TCP connections with no DNS resolution (show IP addresses


netstat -ant
instead).

netstat -al Shows only listening sockets.


Also show PID and to which program each socket belongs, e adds extra
netstat -aep
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.

Displays a table of all network interfaces. Add -e to get output similar to


netstat -i
ifconfig.

netstat -ct Displays TCP connections continuously.

netstat -g Display multicast group membership information for IPv4 and IPv6.

Display all services listening for TCP and UDP, all free open ports on
netstat -lntu
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:

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

Shows all sockets, both listening and non-listening, all protocols like
netstat -a
TCP, UDP etc.

netstat -at Shows only TCP connections (-au shows only UDP connections)

Shows all TCP connections with no DNS resolution (show IP addresses


netstat -ant
instead).

netstat -al Shows only listening sockets.

Also show PID and to which program each socket belongs, e adds extra
netstat -aep
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.
Displays a table of all network interfaces. Add -e to get output similar to
netstat -i
ifconfig.

netstat -ct Displays TCP connections continuously.

netstat -g Display multicast group membership information for IPv4 and IPv6.

Display all services listening for TCP and UDP, all free open ports on
netstat -lntu
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:

You might also like