Which commands can be used to display TCP network connections?
To display TCP network connections, you can use several commands depending on your operating system. Here are some common commands for both Windows and Unix/Linux systems:
netstat
netstat -an
Get-NetTCPConnection (PowerShell)
Get-NetTCPConnection
TCPView
netstat
netstat -tuln
-t
flag is for TCP, -u
for UDP, -l
for listening, and -n
for numeric addresses.ss
ss -tuln
netstat
that provides similar information but is faster and more efficient. The flags are similar to those used in netstat
.lsof
lsof -iTCP -sTCP:LISTEN
iftop
iftop
tcpdump
tcpdump -i <interface> tcp
netstat
, Get-NetTCPConnection
, or TCPView.netstat
, ss
, lsof
, iftop
, or tcpdump
.Make sure to run these commands with appropriate permissions (e.g., as an administrator or with sudo
on Unix/Linux) to see all connections.