Listing Open Sockets and Internet Files with lsof


lsof is a command meaning “list open files”, which is used in many Unix-like systems to report a list of all open files and the processes that opened them. We will look at ways to keep tab open sockets and Internet files with lsof.

To have a real-time tab on open sockets type in watch lsof -i

2007-12-20-064920_1280x800_scrot

 

List all opened Internet and UNIX domain files use lsof -i -U

2007-12-20-065218_1280x800_scrot

Or if you run a webserver and would like to see who is connected to it use lsof -i :80

2007-12-20-071430_1280x800_scrot



Subscribe without commenting


Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.