Operations 5 min read

How to Quickly Identify Which Process Is Using a Port on Linux

This guide explains how to use netstat, ss, lsof, fuser, and nmap commands on Linux to list open ports, interpret their status columns, and determine which processes are occupying specific ports, with installation tips and example outputs.

Open Source Linux
Open Source Linux
Open Source Linux
How to Quickly Identify Which Process Is Using a Port on Linux

Checking Port Usage on Linux

1. netstat or ss commands

Install the required tools if they are missing: yum install -y net-tools Use netstat to display listening sockets and the owning processes: netstat -anlp | grep 8888 Key netstat options:

-t : show TCP ports

-u : show UDP ports

-l : display only listening sockets

-p : show PID and program name

-n : show numeric addresses without DNS lookup

netstat output example
netstat output example

Explanation of the output columns:

Proto : protocol (tcp or udp)

Recv-Q : receive queue size; non‑zero may indicate a DoS attack or backlog

Send-Q : send queue size; non‑zero may indicate slow remote receiver

Local Address : IP and port the socket is bound to (e.g., 0.0.0.0:22, :::22, 127.0.0.1:9100)

Foreign Address : remote endpoint of the connection

State : connection state such as LISTEN, ESTABLISHED, UNKNOWN

PID/Program : process ID and program using the socket

PID/Program column example
PID/Program column example

2. ss command

ss

provides similar information with a faster implementation:

ss -anlp | grep 80

3. lsof command

List open files and the processes that own them, including network sockets:

yum install -y lsof
lsof -i:80

4. fuser command

Show which processes are using a specific file or socket. For example, to check port 22:

yum install -y psmisc
fuser 22/tcp -v

5. nmap tool

Scan local ports quickly:

nmap localhost
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

netstatlsofnmapportss
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.