netstat is one of the most basic network service debugging tools, telling you what ports are open and whether any programs are listening on ports. For example, if you want to view all open TCP ports, run this command:
Table 6-2 lists the
Prints TCP port information
Prints UDP port information
Prints listening ports
Prints every active port
Disables name lookups (useful if DNS isn't working)
Being able to list open and listening ports is good, but our good old friend
lsof can go one step further.
In Finding Open Files with lsof you saw how
lsof can track open files, but
lsof can also list the programs currently using or listening to ports. For a complete ...