FreeBSD Unix Find Out Which Programs Are Listening On a Given Port Number

www.‮ttual‬uri.com
FreeBSD Unix Find Out Which Programs Are Listening On a Given Port Number

To find out which programs are listening on a given port number on a FreeBSD system, you can use the sockstat command. This command is used to display information about sockets on the system.

To find out which programs are listening on a specific port number, you can use the following command:

sockstat -l -P tcp -p port_number

Replace port_number with the port number you are interested in.

For example, to find out which programs are listening on port 80 (the default HTTP port), you can use the following command:

sockstat -l -P tcp -p 80

This will display a list of all the programs that are listening on port 80, along with their process IDs and the users they are running under.

You can also use the netstat command to find out which programs are listening on a given port. To do this, you can use the following command:

netstat -na -f inet -p tcp | grep :port_number

Replace port_number with the port number you are interested in.

Created Time:2017-10-28 20:40:36  Author:lautturi