The Ultimate Linux Command: lsof
Thursday, September 14, 2006
lsof is the Linux/Unix über-tool. I use it most for getting network connection related information from a system, but that's just the beginning for this amazing and little-known application. The tool is aptly called lsof because it "lists open files". And remember, in Unix just about everything (including a network socket) is a file. "
"As you can see, lsof has a truly staggering number of options. You can use it to get information about devices on your system, what a given user is touching at any given point, or even what files or network connectivity a process is using. lsof replaces my need for both netstat and ps entirely. It has everthing I get from those tools and much, much more." Don't worry, the page explains all of these!
Read more!
Visit the lsof homepage!
Note from Nerd: Wow! This is pretty cool! I have never even heard of this command but looks pretty 1337. I have got to try this when I get my computer back up and running (new power supply has been ordered! Should arrive Friday!).
usage: [-?abhlnNoOPRstUvV] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]
[-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]]
[-p s] [+|-r [t]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]]
"As you can see, lsof has a truly staggering number of options. You can use it to get information about devices on your system, what a given user is touching at any given point, or even what files or network connectivity a process is using. lsof replaces my need for both netstat and ps entirely. It has everthing I get from those tools and much, much more." Don't worry, the page explains all of these!
Read more!
Visit the lsof homepage!
Note from Nerd: Wow! This is pretty cool! I have never even heard of this command but looks pretty 1337. I have got to try this when I get my computer back up and running (new power supply has been ordered! Should arrive Friday!).