I have 30 instances of a process running on a server and want to log open files for each process for analysis.
I ran the following command:
* ps auwwx | grep PROG_NAME | awk '{print $2}' | xargs lsof -p | less
It complaints that, "lsof: status error on : No such file or directory"
However, if I run lsof -p < pid >
it gives me the list of open files for that process . How can I get a list of all open files for all 30 instances of the process on a FreeBSD machine.
Moreover, I do not want the shared libraries to be listed. If I do -d "^txt"
it isn't showing some other db files which I want to be shown. Is there any other way to grep out the .so files?