Menu

Comparing Linux and BSD Commands

This page describes various GNU/Linux commands and shows the BSD equivelant commands. I am writing this because one of my biggest problems in switching to BSD was learning how to do the same thing that I already new how to do in Linux.

Note: At the moment, this is just a very rough draft. I plan to add much more detail later, but I do not have the time right now. there may also be errors in the BSD commands, particulaly NetBSD and OpenBSD as I am much less familiar with them. Any suggestions, patches, critiques are welcome.

Linux BSD
Disk Management
Loopback device, losetup, mount -o loop mdconfig (FreeBSD), vnconfig (NetBSD, OpenBSD)
LVM, LVM2 Vinum, GEOM
RAID, MD RAIDframe raid(4), GEOM geom(4)
GEOM is available in FreeBSD 5.x and newer only.
Ext2/3, ReiserFS, XFS, JFS UFS, UFS2
UFS2 is only Available in FreeBSD 5.x and NetBSD 2.x and later.
iso9660 cd9660
mkfs newfs
fdisk fdisk, disklabel
LILO lilo(8), GRUB grub-install(8) fdisk -B, boot0cfg(FreeBSD)
hdparm atacontrol
Networking
ifconfig, iptunnel ifconfig
route route, netstat -r
ipfwadm, ipchains, iptables ipfw(FreeBSD), ipf(FreeBSD), pfctl(All)
pfctl not available in FreeBSD 4.x and earlier.
Traffic Control tc(8) dummynet(4), ALTQ
System Management
/etc/init.d/*, /etc/rc.d/init.d/*, service, chkconfig /etc/rc, /etc/rc.conf, /etc/rc.d/*
Software Management
rpm, dpkg pkg_add, pkg_delete, pkg_info
System Security
SELinux, Grsecurity Secure Levels securelevel(8), MAC mac(3) mac(4)
MAC is supported in FreeBSD 5.x and later only.
Kernel Modules, Device Drivers
insmod, rmmod, lsmod, modprobe, depmod kldstat, kldload, kldunload (FreeBSD)
modload, modstat (NetBSD, OpenBSD)
PCMCIA Management
cardmgr, cardctl pccardd, pccardc

Device File mappings

Linux BSD
Disk Files
/dev/hda, /dev/hda1, /dev/sda, /dev/sda1 /dev/ad0, /dev/ad0s1, /dev/ad0s1a (FreeBSD), /dev/wd0, /dev/wd0a (NetBSD, OpenBSD)
/dev/dsp, /dev/dsp1, /dev/snd/pcmC0D0p, /dev/midi, /dev/snd/midiC0D0 /dev/dsp, /dev/dsp0, /dev/dsp0.0, /dev/dsp1 (FreeBSD), /dev/audio, /dev/audio1 (NetBSD, OpenBSD)
Valid XHTML 1.0 Transitional Valid CSS! Created with Vim