{"id":1000,"date":"2007-09-12T16:36:28","date_gmt":"2007-09-13T00:36:28","guid":{"rendered":"http:\/\/cephas.net\/blog\/2007\/09\/12\/finding-the-number-of-files-of-a-certain-file-type-that-a-process-has-open\/"},"modified":"2007-09-12T16:44:20","modified_gmt":"2007-09-13T00:44:20","slug":"finding-the-number-of-files-of-a-certain-file-type-that-a-process-has-open","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2007\/09\/12\/finding-the-number-of-files-of-a-certain-file-type-that-a-process-has-open\/","title":{"rendered":"Finding the number of files of a certain file type that a process has open"},"content":{"rendered":"<p>Used this week when trying to debug a problem with an application that was resulting in errors that said &#8220;too many files open&#8221;:<\/p>\n<pre>\/usr\/sbin\/lsof -p $processID | grep .$ext | wc -l<\/pre>\n<p>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.<\/p>\n<p>Also, if you run:<\/p>\n<pre>ulimit<\/pre>\n<p>and you get &#8216;unlimited&#8217; as the result, you&#8217;d be wrong to assume that you have an unlimited number of file handles available to you:<\/p>\n<pre>ulimit -n<\/pre>\n<p>will give you the total number of file handles you&#8217;re allowed.<\/p>\n<p>And that&#8217;s one to grow on.<\/p>\n<p>More <a href=\"http:\/\/www.faqs.org\/docs\/securing\/x4733.html\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Used this week when trying to debug a problem with an application that was resulting in errors that said &#8220;too many files open&#8221;: \/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 &hellip; <a href=\"https:\/\/cephas.net\/blog\/2007\/09\/12\/finding-the-number-of-files-of-a-certain-file-type-that-a-process-has-open\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Finding the number of files of a certain file type that a process has open<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/1000"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=1000"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/1000\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=1000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=1000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=1000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}