netstatDisplays all active open network sockets and established connections.
Provides a baseline view of current system-wide network activity.
Shows network connections, listening ports, routing tables and interface statistics. Largely replaced by ss on Linux but still common everywhere.
sudo apt install net-toolsnetstatDisplays all active open network sockets and established connections.
Provides a baseline view of current system-wide network activity.
netstat -aShows all sockets, including both listening and established states (-a).
Comprehensive list of all ports regardless of their current status.
netstat -lLists only sockets that are currently in a listening state (-l).
Identifies ports waiting for incoming connection requests.
netstat -tFilters output to display only TCP protocol connections (-t).
Limits the view to Transmission Control Protocol session data.
netstat -atShows all TCP connections, including listening and active sessions (-at).
Provides a complete picture of all TCP-based service states.
netstat -ltLists only the TCP sockets currently waiting for connections (-lt).
Focuses on available TCP-based server services on the host.
netstat -tnDisplays TCP data with numerical addresses and ports (-tn).
Ideal for high-speed monitoring of active TCP sessions without DNS overhead.
netstat -antCombined view of all TCP sockets (listening and active) in numeric format (-ant).
Provides a rapid and detailed overview of the entire TCP stack state.
netstat -uFilters output to display only UDP protocol connections (-u).
Displays active and recently used User Datagram Protocol socket data.
netstat -auShows all UDP connections, including listening sockets (-au).
Enables discovery of both established flows and available UDP services.
netstat -luLists only UDP sockets that are actively listening for packets (-lu).
Identifies open UDP ports that could be used for incoming payloads.
netstat -unDisplays UDP connections with numerical addresses and ports (-un).
Provides a fast look at UDP traffic without resolving names.
netstat -anuShows all UDP socket states in numerical format (-anu).
Comprehensive and efficient view of all local UDP service availability.
netstat -xDisplays information about active UNIX domain sockets (-x).
Makes local inter-process communication (IPC) channels visible for analysis.
netstat -lxLists only listening UNIX domain sockets (-lx).
Identifies local system services waiting for internal application connections.
netstat -axShows all UNIX domain sockets, both listening and connected (-ax).
Full visualization of internal system-wide socket-based IPC.
netstat -wDisplays raw socket data if supported by the kernel (-w).
Enables visibility of low-level protocol interactions below the transport layer.
netstat -pShows the PID and program name for each network socket (-p).
Critically links network activity to specific running software processes.
Example
sudo netstat -pnetstat -tpDisplays TCP connections with associated process IDs and names (-tp).
Maps transport layer activity directly to the initiating application.
Example
sudo netstat -tpnetstat -upDisplays UDP connections with associated process IDs and names (-up).
Identifies which system processes are handling datagram traffic.
Example
sudo netstat -upnetstat -xlpLists listening UNIX sockets with their associated process info (-xlp).
Allows tracing of internal L5 services back to their binary sources.
Example
sudo netstat -xlpnetstat -tulpnStandard admin view of all listening TCP/UDP ports with PIDs (-tulpn).
Essential tool for auditing server security and verifying listening services.
Example
sudo netstat -tulpnnetstat -anpDisplays all connections and listening ports with PIDs numerically (-anp).
Provides maximum visibility into the entire active network footprint of the OS.
Example
sudo netstat -anpnetstat -epShows process info with extended user ID and inode data (-ep).
Provides deep system integration details for socket-to-file matching.
Example
sudo netstat -epnetstat -eDisplays extended socket info including owner UID and inode (-e).
Useful for determining the security context and identity of connection owners.
netstat -eeDisplays very verbose kernel-level socket information (-ee).
Provides deepest possible visibility into internal networking structures.
netstat -neNumerical addresses combined with extended owner details (-ne).
High-performance view that includes security identifier (UID) for each socket.
netstat -vEnables verbose mode, printing info on protocol family status (-v).
Helps diagnose why certain protocols may not be displaying active sockets.
netstat -WEnables wide mode to prevent address truncation (-W).
Ensures that long IPv6 or hostname strings are fully readable in the output.
netstat -tunlpWShows listening TCP/UDP ports with PIDs and full IP strings (-tunlpW).
Full-detail admin view for comprehensive local service identification.
Example
sudo netstat -tunlpWnetstat -cUpdates the netstat output continuously every second (-c).
Enables real-time monitoring of connection state changes and bursts.
netstat -tcContinuously monitors TCP connection states every second (-tc).
Provides a live dashboard of Transmission Control Protocol activity.
netstat -ucContinuously monitors UDP datagram flow every second (-uc).
Identifies real-time spikes or patterns in User Datagram Protocol usage.
netstat -ancContinuously displays all connections in numeric format (-anc).
Monitors system-wide socket activity without DNS resolution delay.
netstat -oDisplays network state timer information (-o).
Provides visibility into socket timeout, keepalive, and retransmission states.
netstat -toShows TCP connections with their active timer states (-to).
Essential for diagnosing stuck sessions or performance-degrading retransmissions.
netstat -antoDisplays all numerical TCP connections including active timers (-anto).
High-precision diagnostic view for transport-layer protocol behavior.
netstat -apoShows all sockets with PIDs and timer data (-apo).
Enables deep debugging of process-specific network hang issues.
Example
sudo netstat -aponetstat -sDisplays summary statistics for each network protocol (-s).
Aggregates error counts, packet totals, and flow metrics across the stack.
netstat -suShows detailed statistics specifically for the UDP protocol (-su).
Useful for identifying datagram loss or buffer overflow issues in the stack.
netstat -stShows detailed statistics specifically for the TCP protocol (-st).
Enables auditing of connection establishment, segments, and error rates.
netstat -ssDisplays maximal protocol statistics including rare counters (-ss).
Deep-dive audit into low-level protocol event and failure statistics.
netstat -rDisplays the kernel IP routing table (-r).
Visualizes the system's pathing logic for different destination networks.
netstat -rnDisplays the routing table with numerical IP addresses (-rn).
Prevents slow DNS lookups when auditing network routing configurations.
netstat -rFDisplays the Forwarding Information Base routing table (-rF).
Shows the active forwarding rules used by the kernel for packet transit.
netstat -rCDisplays the routing cache for recently used paths (-rC).
Provides visibility into recent destination routing decisions and metrics.
netstat -rneNumerical routing table with extended kernel info (-rne).
Detailed view of paths including MTU, window, and hop characteristics.
netstat -iDisplays a table of all network interfaces and statistics (-i).
Summary of RX/TX packet counts, errors, and drops for each adapter.
netstat -ieDisplays interface statistics in a long format (-ie).
Provides detailed hardware configuration and status mirroring ifconfig output.
netstat -iaShows statistics for all interfaces, including inactive ones (-ia).
Full inventory of physical and virtual networking hardware capabilities.
netstat -4Filters output to show only IPv4 network connections (-4).
Excludes modern IPv6 data to focus on legacy stack auditing.
netstat -6Filters output to show only IPv6 network connections (-6).
Exposes active communications specifically on the modern IPv6 stack.
netstat -l6Displays only listening sockets on the IPv6 family (-l6).
Identifies services exclusively exposed via IPv6 transport protocols.
netstat -u4Displays only UDP connections using IPv4 (-u4).
Targets the User Datagram Protocol specifically on the IPv4 layer.
netstat -t4nShows numerical TCP connections for IPv4 only (-t4n).
Highly specific, high-performance view of legacy transport session data.
netstat --numeric-portsResolves hostnames while keeping port numbers numerical (--numeric-ports).
Provides human-readable targets while maintaining exact technical port identification.
netstat --numeric-hostsNumerical IP addresses with service name resolution (--numeric-hosts).
Easily identifies the type of service (e.g. 'http') while keeping IPs exact.
netstat --numeric-usersShows numerical user IDs (UID) instead of names (--numeric-users).
Crucial for shell-based parsing where UID stability is preferred over names.
netstat -A inetFilters connections to the 'inet' (IPv4) address family (-A inet).
Explicitly selects the IPv4 transport layer for detailed socket analysis.
netstat -A inet6Filters connections to the 'inet6' (IPv6) address family (-A inet6).
Focuses documentation and analysis on the modern IPv6 transport layer.
netstat -A unixExplicitly selects only UNIX domain socket family (-A unix).
Perfect for auditing internal local application inter-communication.
netstat -aneoNumeric view with extended details and connection timers (-aneo).
A deep TCP session analysis view including user identity and inode context.
netstat -tuplnThe ultimate standard command for listing all active listeners (-tupln).
Displays all TCP/UDP ports, numeric targets, and the owning process ID.
Example
sudo netstat -tuplnnetstat -tlnQuick check for open and listening TCP ports (-tln).
Fast standard method for verifying server service availability numerically.
netstat -ulnQuick check for open and listening UDP ports (-uln).
Determines which datagram-based services are active on the host.
netstat -rnCInspects the routing cache to debug routing decisions (-rnC).
Identifies why specific destination traffic might be taking an unexpected path.
netstat -ieChecks for RX/TX errors or dropped packets on interfaces (-ie).
Fundamental tool for diagnosing physical layer or driver-level throughput issues.
netstat -anpMaps connection to PID for malware and intrusion hunting (-anp).
Identifies exact binaries initiating or receiving connections in suspicious patterns.
Example
sudo netstat -anpnetstat -antpFocuses on TCP connections with PIDs to find backdoors (-antp).
Targets unauthorized remote shells or C2 traffic originating from the OS.
Example
sudo netstat -antpnetstat -anupFocuses on UDP to find hidden datagram-based trojans (-anup).
Exposes non-stream communication channels used for data exfiltration.
Example
sudo netstat -anupnetstat -lxpAudits local IPC sockets for suspicious local activities (-lxp).
Uncovers internal process masquerading or illegal local pipe usage.
Example
sudo netstat -lxpnetstat -c -antReal-time monitor of TCP connections for new inbound probes (-c -ant).
Diagnostic tool for watching active port knocking or connection floods.
netstat -s | grep -i retransAnalyzes protocol retransmissions for DoS monitoring (-s).
High numbers of retransmits often indicate a significant network layer bottleneck.
Example
netstat -snetstat -gVerifies host membership in multicast discovery groups (-g).
Checks for participation in protocols like SSDP or mDNS for network leakage.
netstat -ant | grep ESTABLISHEDIdentifies currently active TCP sessions in ESTABLISHED state.
Quickly highlights active infiltration or admin sessions for hijack targeting.
Example
netstat -antnetstat -rnNumerical routing map for internal subnet discovery (-rn).
Builds a logical picture of the network topology for internal pivoting planning.
netstat -puntaFull-stack enumeration of all protocols and their binaries (-punta).
Maximum intensity reconnaissance of the targets' communication footprint.
Example
sudo netstat -puntanetstat -MDisplays legacy IP masqueraded connections (-M).
Required for auditing NAT translation states on ancient Linux kernels.
netstat --symbolicAlternative syntax for enabling symbolic hostname resolution.
Forces the tool to translate IP addresses into readable domain names.
netstat --routeLong-form argument for displaying the kernel routing table.
Human-readable equivalent to the -r flag for easier scripting maintenance.
netstat --interfacesLong-form argument for displaying the network interface table.
Explicitly calls for adapter-level TX/RX and error packet statistics.
The modern Linux socket statistics tool: lists listening ports, established connections and the processes behind them, faster than netstat.
The iproute2 tool for addresses, links, routes, neighbours and network namespaces — the modern replacement for ifconfig and route.
Measures maximum TCP and UDP throughput between two hosts — the standard tool for testing network bandwidth and link quality.
A passive OS fingerprinting tool that identifies operating systems and clients from traffic it observes, without sending any packets.