|
1
在终端下用lsof命令看,最方便
|
|
soulhackerJun 12, 2012
3
直接 lsof 会输出所有的,不过这样一般没啥太大用处,还是看有啥进程在对指定文件做读写比较常用。
|
|
4
對 lsof 輸出所有的啊 一點都不方便
|
|
5
@samuel 找到個這個 但是還是不方便
lsof abc.txt 顯示開啟文件abc.txt的進程 lsof -i :22 知道22端口現在運行什麼程序 lsof -p pid 瞭解進程id對應進程打開的文件 lsof -g gid 顯示歸屬gid的進程情況 lsof +d /usr/local/ 顯示目錄下被進程開啟的文件 lsof +D /usr/local/ 同上,但是會搜索目錄下的目錄,時間較長 lsof -d 4 顯示使用fd為4的進程 lsof -i 用以顯示符合條件的進程情況 語法: lsof -i[46] [protocol][@hostname|hostaddr][:service|port] |
|
6
@samuel 找到個這個 但是還是不方便
lsof abc.txt 顯示開啟文件abc.txt的進程 lsof -i :22 知道22端口現在運行什麼程序 lsof -p pid 瞭解進程id對應進程打開的文件 lsof -g gid 顯示歸屬gid的進程情況 lsof +d /usr/local/ 顯示目錄下被進程開啟的文件 lsof +D /usr/local/ 同上,但是會搜索目錄下的目錄,時間較長 lsof -d 4 顯示使用fd為4的進程 lsof -i 用以顯示符合條件的進程情況 語法: lsof -i[46] [protocol][@hostname|hostaddr][:service|port] |