LSOF Scoped To Multiple PIDs

You can run lsof -p with a comma-delimited list of PIDs — but you can also transform the pidof outputĀ into a comma separated list of PIDs. Which means you can run lsof for all of the PIDs associated with a specific program. In my case, it’s rsync …

lsof -p “$(pidof rsync | tr ‘ ‘ ‘,’)”

Leave a Reply

Your email address will not be published. Required fields are marked *