• หน้าแรก
  • หลักสูตร
  • บทความ
  • ร้านค้า
  • ติดต่อเรา
    มีคำถามเกี่ยวกับ odoo ?
    (02) 4302475
    info@odoothaidev.com
    Login
    Odoothaidev - We are Odoo professional in Thailand
    • หน้าแรก
    • หลักสูตร
    • บทความ
    • ร้านค้า
    • ติดต่อเรา

      Linux

      • บ้าน
      • บล็อก
      • Linux
      • 3 Ways to Find Out Which Process Listening on a Particular Port

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

      • โพสโดย admin
      • หมวดหมู่ Linux, Ubuntu
      • วันที่ สิงหาคม 24, 2021

      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' 
      
      Check Port Using netstat Command
      Check Port Using netstat CommandIn 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
      
      Find Port Using lsof Command
      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=
      
      Find Port and Process ID in Linux
      Find Port and Process ID in Linux

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

      • Share:
      อวตารของผู้เขียน
      admin

      โพสต์ก่อนหน้า

      การใช้ Token เพื่ออัพ Github
      สิงหาคม 24, 2021

      โพสต์ถัดไป

      Odoo Certification Practice Test
      กันยายน 4, 2021

      คุณอาจชอบ

      How to check if port is in use on Linux or Unix
      22 พฤศจิกายน, 2022

      How do I determine if a port is in use u …

      01-Ubuntu-Web-Site-1024×767[1]
      รีวิวการติดตั้ง Ubuntu 16.04 Server
      15 กรกฎาคม, 2019

      ค้นหาบทความ

      หมวดหมู่

      หมวดหมู่

      • Accounting
      • Adobe XD
      • API
      • Blog
      • Business
      • Buttons
      • CRM
      • Custom Fields
      • Design / Branding
      • Django
      • Ecommerce
      • ERP
      • ERP Flow
      • Express
      • Flectra
      • Form View
      • Frontend
      • Github
      • Github
      • Grant Chart
      • Header
      • iReport
      • Jasper Server & Server
      • Jaspersoft Studio
      • Java
      • JSON-RPC
      • Lazada
      • Linux
      • MLM
      • MRP
      • Nignx Proxy
      • NodeJS
      • Odoo 10
      • Odoo 12 Module
      • Odoo 13
      • Odoo 14 Development
      • Odoo 16
      • Odoo 8
      • Odoo 9
      • Odoo API
      • Odoo Certification
      • Odoo Developer
      • Odoo Ebook
      • Odoo Enterprise
      • Odoo ERP
      • Odoo Event
      • Odoo Implement
      • Odoo Inventory
      • Odoo Report
      • Odoo V15
      • Open Source
      • Open-office
      • OpenERP 7.0
      • PhantomJS
      • Postgres SQL
      • Programming Language
      • Project Management
      • Python
      • Python3
      • Qweb
      • Reporting ระบบรายงาน
      • RML Report
      • Search View and Filters
      • Social Network
      • Statusbar
      • Ubuntu
      • Uncategorized
      • Voip & Call Center
      • Warehouse Management
      • WMS
      • Woocommerce
      • Workflow
      • XML-RPC
      • การ Implement
      • การเก็บข้อมูล Pre-Requirement
      • การเตรียมตัวเพื่อใช้งาน erp
      • ความรู้ด้านการตลาด CRM
      • ธีมเว็บไซต์ Odoo
      • ธุรกิจบริการ
      • ธุรกิจประเภทจัดอบรมสัมมนา
      • ธุรกิจสิ่งพิมพ์
      • นักพัฒนา
      • ประเภทธุรกิจที่เหมาะกับ Odoo
      • ระบบบัญชี
      • ระบบเคลม
      • ลิขสิทธิ์ – License
      Introduction LearnPress – LMS plugin

      Introduction LearnPress – LMS plugin

      Free
      From Zero to Hero with Nodejs

      From Zero to Hero with Nodejs

      Free
      Learn Python – Interactive Python

      Learn Python – Interactive Python

      $69.00

      บทความล่าสุด

      V16 Planned Date of Tasks are invisible.
      12ก.พ.2023
      Odoo Implement Methodology
      29พ.ย.2022
      Odoo Enterprise Subscription Agreement
      29พ.ย.2022
      (02) 430-2475
      info@odoothaidev.com
      Facebook Twitter Google-plus Pinterest

      Odoothaidev by OdooTeaM.

      • Privacy
      • Terms
      • Sitemap
      • Purchase

      เข้าสู่ระบบด้วยบัญชีเว็บไซต์ของคุณ

      ลืมรหัสผ่าน?

      Click to Copy