Quick bit of unix trivia!
Every so often I will be recreating one of my Vagrant vm’s, and even though it should have been destroyed I will get errors about forwarded ports colliding.
In this situation I want to verify that it is the vm provider that is locking the port (vmware fusion in my case).
To do that just run:
As an example (using port 80), this is the output I get:
1 2 3 4
At that point I have the PID that I can then terminate expeditiously!!