InfoHeap
Tech tutorials, tips, tools and more
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mac Command Line tutorials

  • Bulk convert jpeg files to png using sips on mac
  • Custom terminal tab title and ssh on mac
  • How to convert text to speech on Mac using command line utility say
  • How to join multiple pdf files on Mac
  • How to use qpdf to add/remove password from pdf on mac
  • Install redis on Mac
  • Mac - find which process is listening on a port
  • Mac - hide and unhide a file or directory
  • Mac - open a terminal from a folder
  • Mac - print java home on command line
  • Mac - search files on command line using mdfind
  • Mac command line convert svg to png
  • Mac command line utility open - some handy tips for better productivity
  • Mac terminal - how to close shell on exit
  • mac pkgutil - quick start guide
 
  • Home
  • > Tutorials
  • > Mac
  • > Mac Command Line

Mac – find which process is listening on a port

on Dec 29, 2022

We can use lsof or netstat to find which process is listening on a port. Here are the steps:

  1. To see which process is listening on port 8080 using netstat
    sudo netstat -anv | grep [.]8080
    tcp4       0      0  127.0.0.1.8080         *.*                    LISTEN      131072 131072  48921      0 0x0100 0x00000106
  2. To see which process is listening using lsof
    sudo lsof -i :8080
    or
    sudo lsof -i -P | grep LISTEN | grep :8080
  3. Once you get the process id, use the ps command to see its name
    ps -f -p 48921

Suggested posts:

  1. Find which process is listening on a port on Linux
  2. Linux – find listening ports
  3. Use netcat (nc) to listen on tcp or udp port
  4. How to use nc (netcat) to print headers sent by a browser
  5. How to show environment variable for a process id (pid)
  6. Find used ports by an app on Android using Adb
  7. CSS – !important examples
  8. minikube kubernetes – how to access specific pod IP endpoint using curl
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Mac, Mac Command Line

Follow InfoHeap

facebook
twitter
googleplus
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries

Copyright © 2023 InfoHeap.

Powered by WordPress