Aaron Johnson Now with 50% less caffeine!

Posted
12 September 2007 @ 4pm

Tagged
Systems Administration

Finding the number of files of a certain file type that a process has open

Used this week when trying to debug a problem with an application that was resulting in errors that said “too many files open”:

/usr/sbin/lsof -p $processID | grep .$ext | wc -l

where $processID is the ID of the process that is opening the files and $ext is the (most likely) three letter file extension of the file that is being open.

Also, if you run:

ulimit

and you get ‘unlimited’ as the result, you’d be wrong to assume that you have an unlimited number of file handles available to you:

ulimit -n

will give you the total number of file handles you’re allowed.

And that’s one to grow on.

More here.


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment

Links: 9-8-2007 Using ROME to get the body / summary of an item