travi / dotfiles

My disaster recovery plan.
21 stars 6 forks source link

create alias to determine what is listening on a certain port #99

Closed travi closed 9 years ago

travi commented 9 years ago

lsof -i TCP:$PORT | grep LISTEN

use sudo for applications not running as current user

travi commented 9 years ago

for windows: netstat -aon | grep "LISTENING[[:space:]]*2020"

travi commented 9 years ago

oops, thats the process id, not the port. would need a better regex to search by port

netstat -aon | grep "LISTENING" | grep ":80" would be better