commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Check open TCP and UDP ports
There is 1 alternative - vote for the best!
Tested in Linux and OSX
While `lsof` will work, why not use the tool designed explicitly for this job?
(If not run as root, you will only see the names of PID you own)
This option selects the listing of all Internet and x.25 (HP-UX) network files.
This option is much faster, as it checks only network nodes.
If you can do better, submit your command here.
You must be signed in to comment.