user@hostname ~ $ sudo lsof -i -P -n | grep LISTEN | grep 1025
mailcatch 1104 root 9u IPv4 27240 0t0 TCP *:1025 (LISTEN)
Reference:
https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/
(first command)
user@hostname ~ $ sudo lsof -i -P -n | grep LISTEN | grep 1025
mailcatch 1104 root 9u IPv4 27240 0t0 TCP *:1025 (LISTEN)
Reference:
https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/
(first command)