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.
i earlier posted the command here and later i was able to know that it was against writers interest.so i am putting the correct link.you can find the post here.
please read my other posts.
Intel open-source project to make Linux better.
Top Tips to increase bittorent download speed
The Most Powerful Linux Command that doesn't come installed with Linux.
Monday, April 30, 2007
Posted by propulsar at 10:28 PM
Labels: BASH, command, LINUX, technology
Subscribe to:
Post Comments (Atom)


20 comments:
really useful command to know. Thanks for sharing info with us.
Thanks,
Suresh kannan.
WTF? I thought the world had got past posting large amounts of text as images.
You may have discovered lsof, but beginners should start with vi
Here I thought it was man! but nobody seems to use that command though :D
Abdul @ Prank Videos
amazing , thanks.
Why did you put this on Digg and aren't even mentioning that you didn't write it?
The original seems to be written by Daniel Miessler here: http://dmiessler.com/study/nix/commands/lsof/
I actually noticed this because I wanted to tell you that they are usually called "options" in UNIX terms, not "switches", so I googled for the sentence that mentions switches to find out if I might still be wrong. But I think years of reading man pages have burned it into my brain: they're called options.
I have been using lsof forever. Comes installed on most distros I have used... Anyway for listening ports I use netstat -n -l -p | grep "<"portnum">" as it is faster. My most common use for lsof lately has been to see what is hogging my soundcard (usually firefox), IE:
for pid in `ps aux | gawk '{print $2}'`; do lsof -p $pid | grep -i snd; done
For aix, its lsof64, however, for some odd reason, I have always encountered a memory fault when running on the production box, not sure why.
/epic/home/myusername>lsof64 -i
lsof64: WARNING: compiled for AIX version 5.1.0.0; this is 5.3.0.0.
Memory fault
Anyone knows why and possible the fix?
Thanks,
Rehman
lsof - list open files
a command line program,
good info.
@interesting articles
I'm with Ramon on this -- why on earth are you posting this (as an image ffs) to Digg instead of the original article?
Also Ramon: I've always called them switches, I assume both terms are used interchangeably.
Well, for me this one comes installed. I use opensuse10.2 ans it's here. by default I think.
I thought everyone used this.
Btw it won't report the sockets of rpc spawned processes (like nfs, portmap, etc).
But luckily you can run rpcinfo -p and get that information.
There's this awesome thing called google, and it makes finding people who repost other people's stuff really easy.
For all those who know how to use this amazing tool called Google (which, just like lsof is a *very* obscure and 1337 tool,) use it to search the name "Daniel Miessler" and find the original.
Ugh.
how did u get iTunes running?? cygwin?
wine?
Sure lsof is a great command, but I have a few points of contention with your article:
1. It does come installed with Linux
2. How can you rip someone else's article completely and post it on your own blog page and think that's okay?
3. Your ads-heavy sidebar cuts off about half of the original article, and you can't scroll the article over because, again it's an image.
4. The only greater tool than lsof is you.
wtf is linux, get windowz u noobs
I actually use lsof very often (several times each day) not only on Linux, as on AIX, Solaris and rarely on Cygwin...
It is really a very powerful and useful command and I recommend everyone to have it installed on their systems.
lsof is quite popular actually, to system administrators mostly.
good work .. dude .. but m new to linux .. all the info is in my hand but i cant understand .. well it take .. time i know .. but its intresting
Post a Comment