Skip to content

Instantly share code, notes, and snippets.

@tsalzer
Created November 6, 2009 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsalzer/227926 to your computer and use it in GitHub Desktop.
Save tsalzer/227926 to your computer and use it in GitHub Desktop.
Solaris: Poor man's lsof
#!/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