3 ms·
You don't have to use lsof for that. Just find the pid of the process that has it open, then cd /proc/<pid>/fd and then ls -l lsof doesn't really do anything f
by ars 17y ago
You don't have to use lsof for that. Just find the pid of the process that has it open, then cd /proc/<pid>/fd and then ls -l
lsof doesn't really do anything for you if you know the pid already. (But it's great if you don't know the pid.)
Then, look through the list for your file, and copy the file descriptor just like in the article.
- ajross 17y agoThis is true, but only in the kinda trivial sense that lsof is just a pretty front end to the /proc filesystem. The same is true of pmap and netstat, but they remain useful tools nonetheless.
- wizard_2 17y agolsof predates the proc filesystem if I recall correctly
- FooBarWidget 17y agoIndeed. lsof is available on OS X too, which doesn't have /proc.