I believe ps -ef
on Mac is nearly equivalent to ps -aux
on linux.
To get what PID has port 8080 in use: lsof -P | grep 8080
The fields map out to:
[mini-nevie:~] nevinwilliams% lsof -P | head -1
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
I started up ttcp -rs
which listens on port 5001.
mini-nevie:~] nevinwilliams% lsof -P | grep 5001
ttcp 27999 nevinwilliams 3u IPv4 0xb70c1f66028d6961 0t0 TCP *:5001 (LISTEN)
and indeed, PID 27999 corresponds to the PID of the ttcp
process I launched.