Pfiles: Difference between revisions
m (New page: Solaris 10 doesn't come with lsof, and a non-root user can't compile and run lsof. However, the '''pfiles''' command in Solaris 10 can offer similar functionality. Unfortunately, it does...) |
mNo edit summary |
||
Line 1: | Line 1: | ||
Solaris 10 doesn't come with lsof, and a non-root user can't compile and run lsof. However, the '''pfiles''' command in Solaris 10 can offer similar functionality. Unfortunately, it doesn't list all files from all processes, but you can check on a single process. | Solaris 10 doesn't come with '''lsof''', and a non-root user can't compile and run lsof. However, the '''pfiles''' command in Solaris 10 can offer similar functionality. Unfortunately, it doesn't list all files from all processes, but you can check on a single process. | ||
<pre> | <pre> | ||
Line 10: | Line 10: | ||
/u/prod/servers/jboss-r/server/20080731/data/hypersonic/localDB.lck | /u/prod/servers/jboss-r/server/20080731/data/hypersonic/localDB.lck | ||
/u/prod/servers/jboss-r/server/20080731/data/hypersonic/localDB.log | /u/prod/servers/jboss-r/server/20080731/data/hypersonic/localDB.log | ||
</pre> | |||
The linux '''netstat''' command has the option to show process id's of the process owning the socket. Solaris doesn't have this capability, but you can get similar affect with pfiles. | |||
<pre> | |||
$ pfiles 8397 | grep port | |||
sockname: AF_INET 10.136.2.242 port: 8080 | |||
$ ps -u ${USER} | awk ' { print $1; }' | xargs pfiles | grep port | sort | uniq | |||
peername: AF_INET 10.123.2.151 port: 8080 | |||
peername: AF_INET 10.123.2.151 port: 9080 | |||
</pre> | </pre> | ||
[[Category:Solaris]] | [[Category:Solaris]] |
Latest revision as of 23:11, 2 September 2008
Solaris 10 doesn't come with lsof, and a non-root user can't compile and run lsof. However, the pfiles command in Solaris 10 can offer similar functionality. Unfortunately, it doesn't list all files from all processes, but you can check on a single process.
$ pfiles 4653 | grep "/" | grep -v "/devices/" 4653: /opt/java/jdk1.5.0_14/bin/amd64/java -Djboss.deploy.env=rhubarb /logs/application/serverlog/stdout.200807312021.log /logs/application/serverlog/gc.log /var/run/name_service_door /logs/application/serverlog/prod.log /u/prod/servers/jboss-r/server/20080731/data/hypersonic/localDB.lck /u/prod/servers/jboss-r/server/20080731/data/hypersonic/localDB.log
The linux netstat command has the option to show process id's of the process owning the socket. Solaris doesn't have this capability, but you can get similar affect with pfiles.
$ pfiles 8397 | grep port sockname: AF_INET 10.136.2.242 port: 8080 $ ps -u ${USER} | awk ' { print $1; }' | xargs pfiles | grep port | sort | uniq peername: AF_INET 10.123.2.151 port: 8080 peername: AF_INET 10.123.2.151 port: 9080