3 ways to know listening ports in linux
1.lsof
2.Nestat
-
-t : Show only TCP sockets on Linux
-
-u : Display only UDP sockets on Linux
-
-l : Show listening sockets. For example, port 22 by SSHD server . 3306 MySQL port 80 web, 443 SSL.
-
-p : List process name that opened sockets(printing program)
-
-n : Don’t resolve service names i.e. don’t use DNS