The Most Powerful Linux Command that doesn't come installed with Linux.

Monday, April 30, 2007

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 i am putting the correct 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



Sureshkannan said...

really useful command to know. Thanks for sharing info with us.

Suresh kannan.

Russell said...

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

abdul said...

Here I thought it was man! but nobody seems to use that command though :D

Abdul @ Prank Videos

balakumar said...

amazing , thanks.

jason said...
This comment has been removed by a blog administrator.
Anonymous said...

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:

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.

???? said...

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

DesignFlaw said...

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; this is
Memory fault

Anyone knows why and possible the fix?



khushnood said...

lsof - list open files

a command line program,
good info.

@interesting articles

John said...
This comment has been removed by a blog administrator.
Henry said...

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.

Stephane said...

Well, for me this one comes installed. I use opensuse10.2 ans it's here. by default I think.

LC said...

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.

Steve said...

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.


Venkatesh Nandakumar said...

how did u get iTunes running?? cygwin?

Some said...

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.

rjodwyer said...

wtf is linux, get windowz u noobs

Antonio Trindade said...

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.

Syahid Ali said...

lsof is quite popular actually, to system administrators mostly.

Killer suv said...

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