[PLUG] lsof
Steve Bonds
1s7k8uhcd001 at sneakemail.com
Thu Sep 4 05:53:01 UTC 2003
On 3 Sep 2003, Dirk Ouellette hapibeli-at-comcast.net |PDX Linux| wrote:
> When trying to find a file that I think may be open, and instead of
> searching through every screen of #/usr/sbin/lsof, can I use grep to
> do a more refined, and quicker search?
If you already know the file you want to check, just:
lsof <filename>
You could also use:
fuser -u <filename>
(I think this works on Linux, but don't have a box handy to check with.)
One of the most common uses I have for lsof is to see what process is
listening on a given TCP port:
lsof -i tcp:80
Shows all processes that have TCP port 80 open.
-- Steve
More information about the PLUG
mailing list