• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

3 Ways to Find Out Which Process Listening on a Particular Port

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
34
VIEWS
Share on FacebookShare on Twitter

Contents

  1. 1. Using netstat Command
  2. 2. Using lsof Command
  3. 3. Using fuser Command

A port is a logical entity which represents an endpoint of communication and is associated with a given process or service in an operating system. In previous articles, we explained how to find out list of all open ports in Linux and how to check if remote ports are reachable using ‘nc’ command.

In this short guide, we will show different ways of finding the process/service listening on a particular port in Linux.

1. Using netstat Command

netstat (network statistics) command is used to display information concerning network connections, routing tables, interface stats and beyond. It is available on all Unix-like operating systems including Linux and also on Windows OS.

In case you do not have it installed by default, use the following command to install it.

$ sudo yum install net-tools	#RHEL/CentOS 
$ sudo apt install net-tools	#Debian/Ubuntu
$ sudo dnf install net-tools	#Fedora 22+

Once installed, you can use it with grep command to find the process or service listening on a particular port in Linux as follows (specify the port).

$ netstat -ltnp | grep -w ':80' 
3 Ways to Find Out Which Process Listening on a Particular Port

Check Port Using netstat Command

In the above command, the flags.

  • l – tells netstat to only show listening sockets.
  • t – tells it to display tcp connections.
  • n – instructs it show numerical addresses.
  • p – enables showing of the process ID and the process name.
  • grep -w – shows matching of exact string (:80).

2. Using lsof Command

lsof command (LiSt Open Files) is used to list all open files on a Linux system. To install it on your system, type the command below.

$ sudo yum install lsof	        #RHEL/CentOS 
$ sudo apt install lsof		#Debian/Ubuntu
$ sudo dnf install lsof		#Fedora 22+

To find the process/service listening on a particular port, type (specify the port).

$ lsof -i :80
3 Ways to Find Out Which Process Listening on a Particular Port

Find Port Using lsof Command

3. Using fuser Command

fuser command shows the PIDs of processes using the specified files or file systems in Linux.

You can install it as follows:

$ sudo yum install psmisc	#RHEL/CentOS 
$ sudo apt install psmisc	#Debian/Ubuntu
$ sudo dnf install psmisc	#Fedora 22+

You can find the process/service listening on a particular port by running the command below (specify the port).

$ fuser 80/tcp

Then find the process name using PID number with the ps command like so.

$ ps -p 2053 -o comm=
$ ps -p 2381 -o comm=
3 Ways to Find Out Which Process Listening on a Particular Port

Find Port and Process ID in Linux

You can also check out these useful guides about processes in Linux.

  1. All You Need To Know About Processes in Linux [Comprehensive Guide]
  2. Limit CPU Usage of a Process in Linux with CPULimit Tool
  3. How to Find and Kill Running Processes in Linux
  4. Find Top Running Processes by Highest Memory and CPU Usage in Linux

That’s all! Do you know of any other ways of finding the process/service listening on a particular port in Linux, let us know via the comment form below.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

29 Practical Examples of Nmap Commands for Linux System/Network Administrators

Next Post

11 Linux Kernel Boot-time Parameters Explained

Next Post

11 Linux Kernel Boot-time Parameters Explained

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet