But you can also use "lsof" command for the purpose.
- Code: Select all
lsof -Pnl +M -i4
for checking IPv4 ports, and
- Code: Select all
lsof -Pnl +M -i6
for checking IPv6 ports
Here:
-P - will stop the conversion of port numbers to port names for network files. This will make lsof run a little faster.
-n - will stop conversion of network numbers to host names for network files. Useful where host name lookup is not working properly.
-l - will stop conversion of user ID numbers to login names.
+M - reports portmapper registrations for local TCP and UDP ports.
-i4 - IPv4 listing only
-i6 - IPv6 listing only
You can use the lsof command without -Pnl and +M option to see the difference in the output.
Here is a sample output from my system. You can also view this post on Network NUTS Facebook Page at http://www.facebook.com/networknuts
