Created
November 6, 2009 11:06
-
-
Save tsalzer/227926 to your computer and use it in GitHub Desktop.
Solaris: Poor man's lsof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Something like lsof. | |
# | |
# Original code found at: | |
# http://blog.pebcak.de/archives/913-Solaris-Poor-mans-lsof-unter-Solaris.html | |
if [ -n "$1" ] ; then | |
for pid in $(ls /proc) ; do | |
pfiles $pid | grep AF_INET | grep $1 >/dev/null && \ | |
echo "PID $pid is listening on port $1"; | |
done | |
else | |
echo "usage: $0 [PORT]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment