Find a program that uses a specific port (OSX)
Let's say you used foreman to serve a Rails application during your development process and accidentally closed your terminal. The Ruby process is still running after you restarted your terminal application, you know the port your Rails server is running with and you want to know which PID the process is using:
lsof -i :<PORTNUMBER>
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 39207 Demo 9u IPv4 0xf1820dff45a4ff5f 0t0 TCP *:hbci (LISTEN)
Written by Daniel Schmidt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#