Table of Contents

BSD Equivilents to Linux Commands

Equivilents

For longtime Linux systems administrators, one of the greatest difficulties is finding the equivalent command in BSD to perform a task. Following table lists some of the ones I finally figured out.

Linux Command BSD Equivalent Description Example
watch cmdwatch Repeatedly execute a command and display result cmdwatch -n 15 df -h
netstat sockstat get list of services providing network listeners sockstat -4l #see only IPv4
lsof fstat Find information on open files fstat /tmp
lsmod kldstat list loaded kernel modules
modprobe kldload/kldunload load or unload kernel modules
lspci pciconf list PCI devices
strace truss trace system calls
update-rc.d sysrc Add/Remove services started at boot sysrc sendmail=YES
cat /proc/cpuinfo sysctl hw View information on CPU on machine sysctl hw
lsblk geom disk list View disk information (but, see below) geom disk list
iptraf iftop watch network traffic iftop -i ge0
systat watch network traffic systat -ifstat 1

Lack of Equivalents

There are some commands that are just not there or without as many options. The information can be found using other means. In many cases, the sysinfo scripts we have shows how to do it, and we have created links below. In other cases, we have linked to other resources.

Linux Command Description Link to script
lsblk Lists block devices. Under BSD, this is a combination of camcontrol, gpart, and grep'ing dmesg https://forums.freebsd.org/threads/lsblk-8-command-for-freebsd.56008/ or, you can use the command geom disk list which is close

References