Unix – Check and Monitor Open Ports and established Connections

lsof -i

lsof -i | less

# firefox example
lsof -i | grep firefox

check every second


while [ "1" ] ; do  clear; lsof -i; sleep 1; done;

# firefox example
while [ "1" ] ; do  clear; lsof -i | grep firefox; sleep 1; done;

netstat |grep localhost

while [ "1" ] ; do
      clear;
      netstat |grep localhost;
      sleep 1;
done;

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *