<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=%E6%AF%8F%E5%A4%A9%E4%B8%80%E5%91%BD%E4%BB%A4%E4%B9%8Blsof</id>
	<title>每天一命令之lsof - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=%E6%AF%8F%E5%A4%A9%E4%B8%80%E5%91%BD%E4%BB%A4%E4%B9%8Blsof"/>
	<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=%E6%AF%8F%E5%A4%A9%E4%B8%80%E5%91%BD%E4%BB%A4%E4%B9%8Blsof&amp;action=history"/>
	<updated>2026-04-17T09:15:51Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.linuxsa.org/index.php?title=%E6%AF%8F%E5%A4%A9%E4%B8%80%E5%91%BD%E4%BB%A4%E4%B9%8Blsof&amp;diff=1351&amp;oldid=prev</id>
		<title>2022年10月14日 (五) 06:34 Evan</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=%E6%AF%8F%E5%A4%A9%E4%B8%80%E5%91%BD%E4%BB%A4%E4%B9%8Blsof&amp;diff=1351&amp;oldid=prev"/>
		<updated>2022-10-14T06:34:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
[[Linux下查看进程打开的文件与打开文件的进程]]&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 list open files&lt;br /&gt;
&lt;br /&gt;
查看某个文件被哪些进程在读写&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
lsof -i:88&lt;br /&gt;
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME&lt;br /&gt;
docker-pr 5479 root    4u  IPv6  54396      0t0  TCP *:kerberos (LISTEN)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
常用选项&lt;br /&gt;
&lt;br /&gt;
 查看某个文件被哪些进程在读写&lt;br /&gt;
&lt;br /&gt;
lsof 文件名&lt;br /&gt;
&lt;br /&gt;
查看某个进程打开了哪些文件&lt;br /&gt;
lsof –c 进程名&lt;br /&gt;
lsof –p 进程号(pid)&lt;br /&gt;
&lt;br /&gt;
lsof用法小全&lt;br /&gt;
lsof abc.txt 显示开启文件abc.txt的进程&lt;br /&gt;
lsof -i :22 知道22端口现在运行什么程序&lt;br /&gt;
lsof -c nsd 显示nsd进程现在打开的文件&lt;br /&gt;
lsof -g gid 显示归属gid的进程情况&lt;br /&gt;
lsof +d /usr/local/ 显示目录下被进程开启的文件&lt;br /&gt;
lsof +D /usr/local/ 同上，但是会搜索目录下的目录，时间较长&lt;br /&gt;
lsof -d 4 显示使用fd为4的进程&lt;br /&gt;
lsof -i [i] 用以显示符合条件的进程情况&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=see also=&lt;br /&gt;
[https://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316599.html linux lsof命令详解]&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/aaronLinux/p/8191510.html lsof查看哪些设备/文件被占用或者打开]&lt;br /&gt;
 [[category:ops]]&lt;/div&gt;</summary>
		<author><name>Evan</name></author>
	</entry>
</feed>