Monday 18 November 2013

LINUX ACTIVE PORTS LIST COMMAND

To view Linux active ports

To list all active ports
netstat -l Active

To list listening ports
netstat --listen -A inet

To list -t for TCP and -u for UDP ports
netstat -n -A inet -t | -u

OR

To list all active ports lsof -i

To list ipv4 TCP active ports
lsof -i4TCP

To list ipv4 UDP active ports
lsof -i4UDP



To get PID of a process
ps -ef | grep firefox

OR

pgrep firefox

pgrep ssh


No comments:

Post a Comment