The netstat tool is a utility for querying current network connections, available for use across Linux, Windows, and MacOS operating systems. It can be executed from the command-line interface by simply running the netstat command.
Common parameters for netstat include:
For example:
$ netstat -uplnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1491/sshd
tcp6 0 0 :::22 :::* LISTEN 1491/sshd
udp 0 0 127.0.0.1:323 0.0.0.0:* 655/chronyd
udp 0 0 0.0.0.0:68 0.0.0.0:* 1312/dhclient
udp6 0 0 ::1:323 :::* 655/chronyd
To check if a specific application is running on port 1000, the following command can be used. If a record appears, it indicates that both the application and port configuration are correct.
netstat -nlp | grep 1000
23-02-2024 02:02:07
22-02-2024 03:19:32
22-02-2024 03:16:03
22-02-2024 03:14:03
22-02-2024 03:11:58