From time to time it’s handy to be able to see exactly which process is using a particular port on a Linux system – especially if you’re debugging issues.
This command will let you see exactly what’s going on – you simply change the port number:
lsof -i:80
If you need the standard port numbers you can check this list
Robert McKenzie says
Nice tip.. a good variant to that would be:
watch lsof -n -i:80
This will update every 2 seconds (the default for the watch command), I’ve included the “-n” for lsof to disable DNS lookups, it could cause display issues with watch on it’s default update times.
If you’re not familiar with the “watch” command, check it out, very useful!
Michele Neylon says
Oh handy – thanks!