Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Linux / Find a Linux Process Listening on a Specific Port

February 23, 2024

Find a Linux Process Listening on a Specific Port

This article shows how to find a process listening on a specific port in Linux.

Use the following command to find a process name listening on a specific port:

$ sudo lsof -i :8000

This example shows that the python3 process is listening on port 8000.

lsof - Find the process listening on a port in Linux

You can list the Linux processes that are listening on any TCP or UDP port:

$ sudo netstat -lntup| grep LISTEN

Here are the keys to use:

  • -l – show listening ports only
  • -n – display IP addresses and port numbers in numerical form and do not resolve them (check the /etc/services file to find the mappings between port numbers and service names)
  • -t – show open TCP ports
  • -u – show open UDP ports
  • -p – show the ID of the process listening on the port

netstat -lntup: list open ports in Linux

We have found the PID of the process using the port, and can now display detailed process information:

$ ps -aux | grep 72005

In this example, the process is started manually by the root user with the following command: python3 -m http.server (is used to run a simple HTTP server to share the current directory).

Get command to start a process listening on a Linux port

To kill the process listening on the busy port you want to free, run:

$ sudo kill -9 72005

You can check that the port is free now:

$ sudo lsof -i :8000

See the previous post on how to find a process listening on a specific port in Windows.
0 comment
0
Facebook Twitter Google + Pinterest
LinuxQuestions and Answers
previous post
Steps to Mount an ISO Image File on Linux
next post
Create a Custom Windows Image with Pre-installed Apps

Related Reading

Fixing ‘The Network Path Was Not Found’ 0x80070035...

August 31, 2023

How to Use Ansible to Manage Windows Machines

March 12, 2024

Recovering Files from BitLocker Encrypted Drive

March 13, 2024

Get Started with Docker on Windows (WSL2) without...

September 4, 2024

Turn Linux Computer into Wi-Fi Access Point (Hotspot)

March 11, 2024

How to Increase Size of Disk Partition in...

March 11, 2024

Printing from Linux to a Windows Shared Printer

May 29, 2024

Install Any OS from ISO Image over Network...

June 24, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
  • Recovering Files from BitLocker Encrypted Drive
  • Install Any OS from ISO Image over Network with iVentoy
  • Monitoring Domain Name Expiration Date with Zabbix
  • Printing from Linux to a Windows Shared Printer
  • Get Started with Docker on Windows (WSL2) without Docker Desktop
  • Turn Linux Computer into Wi-Fi Access Point (Hotspot)
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top