Community Page
- www.tech-recipes.com/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Thats cool Stuff as i m Nebie to unix
- Thnks You............
- hey babes its chris brown babes add me sexy lades 4032 4504 5276 6539
- hey everyone add me love yah 4032 4504 5276 6539 4032 4504 5276 6539
- Great dude .. this works
Tech-Recipes
Cookbook of Tech TutorialsFind out which process is holding which socket open | UNIX | Tech-Recipes
Started by qdideas · 9 months ago
5 years ago
So instead of netstat -an, try netstat -anp.
5 years ago
4 years ago
echo "which port?> "
read port
for pid in `ps -ef -o pid | tail +2`
do
foundport=`/usr/proc/bin/pfiles $pid 2>&1 | grep "sockname:" | grep "por
t: $port$"`
if [ "$foundport" != "" ]
then
echo "proc: $pid, $foundport"
fi
done