How to Check Which Process Is Using a Port in Linux (ss, lsof, netstat)
Problem Overview
When a service fails to start or a port shows as “already in use”, it usually means another process is already listening on that port.
To fix the issue, you first need to identify which process is using the port and stop or reconfigure it safely.
Prerequisites
Before starting, make sure the following conditions are met:
Terminal access with sudo privileges
Basic understanding of services and processes
Solution
- Check port usage with ss (socket statistics), It is the preferred tool on modern Linux systems and replaces
netstat.[root@pythonlinuxhub ~]# sudo ss -tulpn | grep :80 tcp LISTEN 0 511 *:80 *:* users:(("httpd",pid=2899,fd=4),("httpd",pid=2898,fd=4),("httpd",pid=2897,fd=4),("httpd",pid=2892,fd=4))
- Check using
lsof, It lists open files, and in Linux, ports are treated as files.[root@pythonlinuxhub ~]# sudo lsof -i :80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME httpd 2892 root 4u IPv6 33917 0t0 TCP *:http (LISTEN) httpd 2897 apache 4u IPv6 33917 0t0 TCP *:http (LISTEN) httpd 2898 apache 4u IPv6 33917 0t0 TCP *:http (LISTEN) httpd 2899 apache 4u IPv6 33917 0t0 TCP *:http (LISTEN)This method is very useful when you need user ownership and detailed process info.
- Check using
netstat, It is deprecated but still available on older Linux distributions.[root@pythonlinuxhub ~]# netstat -tulpn | grep :80 tcp6 0 0 :::80 :::* LISTEN 2892/httpdIf
netstatis not installed, install it usingyum install net-tools
Once you identify the PID, inspect it before stopping
ps -fp
- Gracefully stop the process
sudo kill
- If the process does not stop
sudo kill -9
Some ports are opened by services controlled by
systemctl.- Identify the service
sudo systemctl status
- Stop the service safely
sudo systemctl stop
- Prevent if from starting on boot
sudo systemctl disable
- Identify the service
Note:
- Do not kill system-critical services blindly. Always verify what the process is and whether it’s managed by
systemd.
Shaik Mohammed Faruk
Software Engineer sharing practical tutorials and insights on Linux, Python, SQL, and modern technologies.
Read more About Me

VIPPH1 is similar enough in what the other one does. I would check this out too if you want. Checkout vipph1
Need to download the jilibetapk, is it safe? Does it work well on Android? I want a smooth experience. Learn more jilibetapk.
Phspinapp good app to play, need to try! Free spins and good payout right? Wanna know more about how to play. Checkout phspinapp.
The graphics are crisp and the gameplay is addictive. I love how easy it is to navigate the site. Give phokgameslogin a try, you won’t regret it.
Best gaming experience I have had in a long time. The bonuses are actually helpful and not just for show. Definitely try ph69jili if you want real action.
The interface is so user-friendly and it loads quickly on my phone. I had a blast playing last night. Definitely give kr39korwin a try if you love winning big.
Sangat puas main di sini, proses deposit dan withdraw sangat cepat. Mantap sekali pelayanan dari idkudaemas88, recommended banget buat semua.
I was looking for a reliable place to grab the latest APKs and this site really delivered. The download speed is impressive and everything works perfectly. Definitely checking out in7apkdownloadin again soon!
This site has a great vibe and the payouts are consistent. I love how easy it is to navigate through the different sections. Happy with xxx999bet so far.
Finally found a place that doesn’t lag during the big wins. The login process is quick and the support team is actually helpful. Give jb777login a try
The bonus offers here are insane compared to other sites I’ve tried. Everything is straightforward and the support team is helpful. Just use ricabetlogin to get started.
If you are into slots then this is the spot. The graphics are crisp and the winning streaks have been pretty decent so far. Give idrakyatslot a try.
The variety of games here is insane. I spent the whole weekend exploring different slots and had a blast. 366betcassinoonline is my new favorite haunt.
Very professional setup and the withdrawal process is incredibly fast. No more waiting for days to get my winnings. idjitu100 is the real deal.
I just downloaded the app and the experience is super smooth. The interface is very intuitive and the games load quickly. Definitely a great choice for anyone looking for a reliable platform. Check out inspin777apk for more details!
The game selection is top notch. I spend most of my free time exploring the slots on q98game.
Feeling lucky today! Just won a big prize and the process to claim it was effortless. Big thanks to kr7luckcasino for the great service.
Really impressed with the security and speed of bitpkrgame. Everything feels professional and the gaming experience is top notch. Definitely my new go-to site.
I love the community vibe and the fair play aspect of this site. It feels like a trustworthy place to put my time and money. Definitely give phstrzbet a try.
The graphics and sound effects on this site are amazing. It makes the whole experience much more immersive. Highly suggest visiting phgamephp for some high quality gaming.
The login process is super quick and the bonuses for new members are actually worth it. Love the vibe here at jilibet020login
Simple registration and a very clean layout. I love how straightforward everything is. I always use kudaemas88login for my daily spins.
The jackpot hits here feel way more frequent than on other sites. It is such a thrill every time I spin. I am totally hooked on slotmax.
Fast deposits and even faster withdrawals. That is all I really care about and this site delivers. 1pra1bet is a winner in my book.
The graphics and sounds make the whole experience so immersive. It feels like a real casino right in my room. Love richjili777!
The game selection is massive and everything loads so quickly. It is definitely one of the best online gaming spots I have found. nustargameonlinegame is awesome.
The graphics are stunning and the gameplay is fair. I had a great winning streak yesterday! Cheers to idmodal777
Quick deposits and even quicker wins! I love how straightforward everything is on this site. Definitely visiting bet393 more often.
Great platform with a very professional feel. I appreciate the security measures they have in place for deposits. bdk7777vip is definitely a five star choice for me.
I’ve tried a few apps lately but this one is definitely the smoothest. The interface is super easy to navigate and the payouts are quick. Highly recommend phgperyaapp for anyone looking for some real excitement.
If you are looking for a trusted site with a huge variety of options, this is it. I have tried many others but mpoasia88 feels much more authentic.
The most transparent platform I have used in the PH region. Very intuitive design and easy to navigate. polymarketphilippines is the way to go.
Really impressed with the graphics and the overall feel of the platform. It feels very professional and secure. I’m sticking with gtwinapp from now on.
Login is super quick and I love the bonuses they offer for new users. It makes the whole gaming session much more exciting. Check out winph55loginapp if you want some real action.
I feel like my luck has actually changed since I started playing here. The graphics are great and the vibe is just right. Love everything about pklucky33game.
Finally found a smooth way to get the app. The installation was super quick and everything works perfectly on my phone. Highly recommend j77gamedownload for anyone looking for a hassle-free setup!
Really enjoying the vibe here. Everything is localized perfectly and the withdrawal process is super quick. Visit phpgophilippines for a great time.
Finally found a place where the app installs without any glitches. The loading speed is impressive and the gameplay is top-notch. Just get the yooe777download and start playing.
Really impressed with the bonuses they offer for new members. It gave me a great head start to explore the games. Give bdppc88 a shot!
The loading speed is amazing and the graphics are top notch. I had a lucky streak yesterday thanks to pkm555.
The login process is seamless and I didn’t encounter any glitches. It is a reliable spot for some quality gaming time. Keep it up bakso108login!
Fast deposits and even faster withdrawals. I really appreciate the transparency of krrwin.
Finally found a platform that doesn’t lag during peak hours. Everything feels professional and the games are top notch. Highly recommend checking out f05com if you want a reliable spot.
I’ve tried a few platforms lately but this one really stands out. The interface is smooth and the payouts are surprisingly fast. Definitely worth checking out phjljl789
Really impressed with the variety of games available here. There is always something new to explore. See you all at bdbjbaji777
The VIP treatment here is real. I feel valued as a player and the bonuses are actually worth it. Join 989betvip
Honestly the best experience I have had in a while. The interface is smooth and the payouts are fast. Highly recommend idperangjitu to everyone.
I’ve been playing here for a few weeks and the payouts are surprisingly fast. Definitely one of the best options for slots right now. Check out ph38jili
Clean design and very straightforward. No annoying pop-ups or complicated menus, just straight to the action. Love krscbet.
I’ve been looking for a reliable way to access my account and this site is a lifesaver. Super fast loading and very intuitive interface. Highly recommend phx777link to everyone here!