Check If A Port Is In Use
The lsof
command is used to list open files. This includes listing network connections. This means I can check if a particular port is in use and what process is using that port. For instance, I can check if my rails application is currently running on port 3000.
I can see that a ruby process (my rails app) is using port 3000. The PID and a number of other details are included.
See more details with man lsof
.
h/t Mike Chau
Last updated