A Unix Utility to Know About: lsof (2009)
catonmat.net
A Unix Utility to Know About: lsof (2009)
1–10 of 54 posts
Re: A Unix Utility to Know About: lsof (2009)
#2Re: A Unix Utility to Know About: lsof (2009)
#3`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
In regard to ps you can memorize a few commands until something truly weird comes up since you will probably use other more specialized snapshotting and tracing tools for anything somewhat difficult to troubleshoot.
Re: A Unix Utility to Know About: lsof (2009)
#4Re: A Unix Utility to Know About: lsof (2009)
#5 function fuser($relativeFile){
$file = Resolve-Path $relativeFile
foreach ( $Process in (Get-Process)) {
foreach ( $Module in $Process.Modules) {
if ( $Module.FileName -like "$file*" ) {
$Process | select id, path
}
}
}
}
In use: > fuser .\node_modules\
Id Path
-- ----
2660 C:\Program Files\nodejs\node.exe
Since it's object pipelining, you can: > fuser .\node_modules\ | killRe: A Unix Utility to Know About: lsof (2009)
#6`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
Sometimes powerful tools require effort to understand. Lsof is absolutely something you should spend some real time grokking. In regard to ps you can memorize a few commands until something truly weird comes up since you will probably use other more specialized snapshotting and tracing tools for anything somewhat difficult to troubleshoot.
Yup, this is true. And I did. But sometimes you just need less dense manual pages.
Re: A Unix Utility to Know About: lsof (2009)
#7`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
edit: `ps aux|grep`, indeed. Silly me in the early hours of a rest day :).
Re: A Unix Utility to Know About: lsof (2009)
#8What kernel functions does this command invoke to retrieve this information? How could I write my own version of lsof?
Re: A Unix Utility to Know About: lsof (2009)
#9`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
Sometimes powerful tools require effort to understand. Lsof is absolutely something you should spend some real time grokking. In regard to ps you can memorize a few commands until something truly weird comes up since you will probably use other more specialized snapshotting and tracing tools for anything somewhat difficult to troubleshoot.
- grep bash /proc/*/status
- readlink /proc/*/fd/* | grep /runRe: A Unix Utility to Know About: lsof (2009)
#10`lsof` and `ps` have the most dense man pages I have ever tried to plow through, and that's causing me to use these tools only at a minimum.
I am guilty of using `ps|aux` for the sole purpose of answering this question: Is it (still) running ? edit: `ps aux|grep`, indeed. Silly me in the early hours of a rest day :).