FreeBSD List / Display Open Ports With sockstat Command
You can use traditional netstat / lsof command to lists open Internet or UNIX domain sockets on FreeBSD. FreeBSD comes with a simple and easy to use command called sockstat.
The -4 option only displays IPv4 sockets.
The -6 option only displays IPv6 sockets.
The -c option only displays connected sockets.
The -l option only displays listening sockets (open port).
For example, display IPv4 related open ports, enter:
# sockstat -4 -l
Output:
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS root sendmail 653 3 tcp4 127.0.0.1:25 *:* root sshd 647 3 tcp4 10.20.110.2:22 *:* root ntpd 616 4 udp4 *:123 *:*
Here the equivalent of netstat:
$ netstat -nat | grep LISTEN
For information read sockstat command man page:
$ man sockstat
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in...
- FreeBSD > How to setup FreeBSD as DNS client?
- Understanding Linux networking stack ~ from sockets to device drivers
- FreeBSD Download Sun Java JDK and JRE 1.5 Binaries
- Postfix masquerading or changing outgoing SMTP email or mail address
- XEN Server Status Monitoring Command Cheat Sheet
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: display ipv4 ports, display ipv6 ports, display running services, freebsd list open port, freebsd list open ports, ipv4, ipv6, netstat command, open bsd ports, open ports, proto, sockstat Command, unix domain sockets ~ Last updated on: February 8, 2008



Recent Comments
Today ~ 34 Comments
Today ~ 10 Comments
Today ~ 6 Comments
Today ~ 15 Comments
Today ~ 5 Comments