<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Linux: use lsof to find which files are open by a process</title>
	<atom:link href="http://www.rustyrazorblade.com/2008/12/linux-use-lsof-to-find-which-files-are-open-by-a-process/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com/2008/12/linux-use-lsof-to-find-which-files-are-open-by-a-process/</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Thu, 22 Jul 2010 09:10:54 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jon</title>
		<link>http://www.rustyrazorblade.com/2008/12/linux-use-lsof-to-find-which-files-are-open-by-a-process/comment-page-1/#comment-33315</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Wed, 24 Dec 2008 19:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=450#comment-33315</guid>
		<description>Clearly I should have checked the man page.  Thanks for the tip.</description>
		<content:encoded><![CDATA[<p>Clearly I should have checked the man page.  Thanks for the tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoner</title>
		<link>http://www.rustyrazorblade.com/2008/12/linux-use-lsof-to-find-which-files-are-open-by-a-process/comment-page-1/#comment-33307</link>
		<dc:creator>Stoner</dc:creator>
		<pubDate>Wed, 24 Dec 2008 15:27:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=450#comment-33307</guid>
		<description>Instead of listing every open file handle on a system and grepping through it, lsof lets you specify a list of PIDs to show open file handles for. It&#039;s the -p parameter.

lsof -p 

Of course, it helps to run this using sudo or as the user running the mysqld process, otherwise you get something like this:

[jstoner@mars ~]$ /usr/sbin/lsof -p 1866
COMMAND  PID  USER   FD      TYPE DEVICE SIZE NODE NAME
mysqld  1866 mysql  cwd   unknown                  /proc/1866/cwd (readlink: Permission denied)
mysqld  1866 mysql  rtd   unknown                  /proc/1866/root (readlink: Permission denied)
mysqld  1866 mysql  txt   unknown                  /proc/1866/exe (readlink: Permission denied)
mysqld  1866 mysql NOFD                            /proc/1866/fd (opendir: Permission denied)</description>
		<content:encoded><![CDATA[<p>Instead of listing every open file handle on a system and grepping through it, lsof lets you specify a list of PIDs to show open file handles for. It&#8217;s the -p parameter.</p>
<p>lsof -p </p>
<p>Of course, it helps to run this using sudo or as the user running the mysqld process, otherwise you get something like this:</p>
<p>[jstoner@mars ~]$ /usr/sbin/lsof -p 1866<br />
COMMAND  PID  USER   FD      TYPE DEVICE SIZE NODE NAME<br />
mysqld  1866 mysql  cwd   unknown                  /proc/1866/cwd (readlink: Permission denied)<br />
mysqld  1866 mysql  rtd   unknown                  /proc/1866/root (readlink: Permission denied)<br />
mysqld  1866 mysql  txt   unknown                  /proc/1866/exe (readlink: Permission denied)<br />
mysqld  1866 mysql NOFD                            /proc/1866/fd (opendir: Permission denied)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
