Hardware Information
| Task |
FreeBSD |
Linux |
| List PCI devices |
pciconf -lv |
lspci -v |
| List USB devices |
usbconfig |
lsusb |
| Show CPU info |
sysctl hw.model or dmesg \| grep CPU |
cat /proc/cpuinfo or lscpu |
| Show memory info |
sysctl hw.physmem or top |
free -h or cat /proc/meminfo |
| Show kernel modules |
kldstat |
lsmod |
| Load kernel module |
kldload module_name |
modprobe module_name |
| Unload kernel module |
kldunload module_name |
modprobe -r module_name |
Disk and Storage Management
| Task |
FreeBSD |
Linux |
| List all disks |
geom disk list |
lsblk or fdisk -l |
| Show disk partitions |
gpart show |
fdisk -l or parted -l |
| Show disk usage |
df -h |
df -h |
| Show mounted filesystems |
mount |
mount or findmnt |
| Check filesystem |
fsck |
fsck |
| Show SMART data |
smartctl -a /dev/ada0 |
smartctl -a /dev/sda |
| List ZFS pools |
zpool list |
zpool list (if ZFS installed) |
| Show ZFS datasets |
zfs list |
zfs list (if ZFS installed) |
Network Commands
| Task |
FreeBSD |
Linux |
| Show network interfaces |
ifconfig |
ip addr or ifconfig |
| Configure interface |
ifconfig em0 inet 192.168.1.10 |
ip addr add 192.168.1.10/24 dev eth0 |
| Show routing table |
netstat -rn |
ip route or route -n |
| Add static route |
route add default 192.168.1.1 |
ip route add default via 192.168.1.1 |
| Show ARP table |
arp -a |
arp -a or ip neigh |
| Clear ARP entry |
arp -d hostname |
arp -d hostname or ip neigh del |
| Show network statistics |
netstat -s |
netstat -s or ss -s |
| Show listening ports |
sockstat -l or netstat -an |
ss -tuln or netstat -tuln |
| Show all open ports/connections |
sockstat |
ss -tuan or netstat -tuan |
| Packet capture |
tcpdump -i em0 |
tcpdump -i eth0 |
Process Management
| Task |
FreeBSD |
Linux |
| List all processes |
ps aux |
ps aux |
| Process tree |
pstree |
pstree or ps axjf |
| Real-time process view |
top |
top or htop |
| Kill process |
kill PID |
kill PID |
| Show open files by process |
fstat |
lsof |
| Show process using port |
sockstat -p 80 |
lsof -i :80 or ss -tulpn \| grep :80 |
Package Management
| Task |
FreeBSD |
Linux (varies by distro) |
| Install package |
pkg install package_name |
apt install / yum install / dnf install |
| Remove package |
pkg delete package_name |
apt remove / yum remove / dnf remove |
| Update package list |
pkg update |
apt update / yum check-update |
| Upgrade packages |
pkg upgrade |
apt upgrade / yum upgrade / dnf upgrade |
| Search packages |
pkg search keyword |
apt search / yum search / dnf search |
| Show package info |
pkg info package_name |
apt show / yum info / dnf info |
| List installed packages |
pkg info |
dpkg -l / rpm -qa |
System Services
| Task |
FreeBSD |
Linux (systemd) |
| Start service |
service servicename start |
systemctl start servicename |
| Stop service |
service servicename stop |
systemctl stop servicename |
| Restart service |
service servicename restart |
systemctl restart servicename |
| Service status |
service servicename status |
systemctl status servicename |
| Enable at boot |
sysrc servicename_enable="YES" |
systemctl enable servicename |
| Disable at boot |
sysrc servicename_enable="NO" |
systemctl disable servicename |
| List all services |
service -e |
systemctl list-units --type=service |
Firewall
| Task |
FreeBSD (pf/ipfw) |
Linux (iptables/nftables) |
| Show rules (pf) |
pfctl -sr |
iptables -L -n -v |
| Show rules (ipfw) |
ipfw list |
nft list ruleset |
| Enable firewall (pf) |
pfctl -e |
systemctl start firewalld |
| Disable firewall (pf) |
pfctl -d |
systemctl stop firewalld |
| Reload rules (pf) |
pfctl -f /etc/pf.conf |
iptables-restore < /etc/iptables/rules.v4 |
System Information
| Task |
FreeBSD |
Linux |
| System uptime |
uptime |
uptime |
| Kernel version |
uname -a or freebsd-version |
uname -a |
| Show all sysctl variables |
sysctl -a |
sysctl -a |
| Show system messages |
dmesg |
dmesg or journalctl -k |
| Show system logs |
tail /var/log/messages |
journalctl or tail /var/log/syslog |
User Management
| Task |
FreeBSD |
Linux |
| Add user |
adduser or pw useradd username |
useradd username or adduser username |
| Delete user |
rmuser or pw userdel username |
userdel username |
| Modify user |
pw usermod username |
usermod username |
| Change password |
passwd username |
passwd username |
| Show logged-in users |
who or w |
who or w |
File Systems
| Task |
FreeBSD |
Linux |
| Mount filesystem |
mount /dev/ada0p2 /mnt |
mount /dev/sda2 /mnt |
| Unmount filesystem |
umount /mnt |
umount /mnt |
| Create UFS filesystem |
newfs /dev/ada0p2 |
N/A (UFS not common) |
| Create ext4 filesystem |
N/A |
mkfs.ext4 /dev/sda2 |
| Check disk space |
du -sh /path |
du -sh /path |
ZFS Commands (Same on FreeBSD and Linux with ZFS)
Pool Operations
| Task |
Command |
Example |
| List all pools |
zpool list |
zpool list |
| Show pool status |
zpool status |
zpool status tank |
| Show pool history |
zpool history |
zpool history tank |
| Show pool I/O statistics |
zpool iostat |
zpool iostat -v 2 (every 2 seconds) |
| Create simple pool |
zpool create |
zpool create tank /dev/ada1 |
| Create mirror pool |
zpool create |
zpool create tank mirror /dev/ada1 /dev/ada2 |
| Create RAIDZ pool |
zpool create |
zpool create tank raidz /dev/ada1 /dev/ada2 /dev/ada3 |
| Add disk to pool |
zpool add |
zpool add tank /dev/ada4 |
| Replace disk in pool |
zpool replace |
zpool replace tank /dev/ada1 /dev/ada4 |
| Remove device from pool |
zpool remove |
zpool remove tank /dev/ada4 |
| Scrub pool (check integrity) |
zpool scrub |
zpool scrub tank |
| Stop scrub |
zpool scrub -s |
zpool scrub -s tank |
| Clear pool errors |
zpool clear |
zpool clear tank |
| Export pool |
zpool export |
zpool export tank |
| Import pool |
zpool import |
zpool import tank |
| List importable pools |
zpool import |
zpool import (without pool name) |
| Upgrade pool |
zpool upgrade |
zpool upgrade tank |
| Set pool property |
zpool set |
zpool set autoreplace=on tank |
| Get pool properties |
zpool get |
zpool get all tank |
Dataset (Filesystem) Operations
| Task |
Command |
Example |
| List all datasets |
zfs list |
zfs list |
| List with specific properties |
zfs list |
zfs list -o name,used,avail,mountpoint |
| List snapshots |
zfs list -t snapshot |
zfs list -t snapshot |
| Create dataset |
zfs create |
zfs create tank/home/user |
| Destroy dataset |
zfs destroy |
zfs destroy tank/old_data |
| Destroy dataset and children |
zfs destroy -r |
zfs destroy -r tank/old_data |
| Set dataset property |
zfs set |
zfs set compression=lz4 tank/home |
| Get dataset properties |
zfs get |
zfs get all tank/home |
| Set quota |
zfs set quota= |
zfs set quota=10G tank/home/user |
| Set reservation |
zfs set reservation= |
zfs set reservation=5G tank/database |
| Mount dataset |
zfs mount |
zfs mount tank/home |
| Unmount dataset |
zfs unmount |
zfs unmount tank/home |
| Show mounted ZFS filesystems |
zfs mount |
zfs mount (without arguments) |
Snapshot Operations
| Task |
Command |
Example |
| Create snapshot |
zfs snapshot |
zfs snapshot tank/home@backup-2024 |
| Create recursive snapshot |
zfs snapshot -r |
zfs snapshot -r tank/home@daily-2024 |
| List snapshots |
zfs list -t snapshot |
zfs list -t snapshot -r tank/home |
| Rollback to snapshot |
zfs rollback |
zfs rollback tank/home@backup-2024 |
| Destroy snapshot |
zfs destroy |
zfs destroy tank/home@old-backup |
| Rename snapshot |
zfs rename |
zfs rename tank/home@old tank/home@archived |
| Clone snapshot |
zfs clone |
zfs clone tank/home@backup tank/home_clone |
| Show snapshot disk usage |
zfs list -o space |
zfs list -r -o space tank |
Send/Receive (Replication)
| Task |
Command |
Example |
| Send snapshot |
zfs send |
zfs send tank/home@backup > /backup/home.zfs |
| Send incremental |
zfs send -i |
zfs send -i @snap1 tank/home@snap2 > incremental.zfs |
| Receive snapshot |
zfs receive |
zfs receive tank/home_restore < /backup/home.zfs |
| Send over SSH |
zfs send \| ssh |
zfs send tank/home@backup \| ssh user@host zfs receive tank/backup |
| Dry-run receive |
zfs receive -n |
zfs receive -n tank/test < backup.zfs |
| Send with progress |
zfs send -v |
zfs send -v tank/home@backup > backup.zfs |
Common Property Settings
| Task |
Command |
Example |
| Enable compression |
zfs set compression= |
zfs set compression=lz4 tank/data |
| Enable deduplication |
zfs set dedup= |
zfs set dedup=on tank/backup |
| Set record size |
zfs set recordsize= |
zfs set recordsize=1M tank/media |
| Enable encryption |
zfs create -o encryption= |
zfs create -o encryption=on -o keyformat=passphrase tank/secure |
| Set access time |
zfs set atime= |
zfs set atime=off tank/database |
| Set sync behavior |
zfs set sync= |
zfs set sync=disabled tank/temp |
| Enable case insensitivity |
zfs set casesensitivity= |
zfs create -o casesensitivity=insensitive tank/windows |
Monitoring and Maintenance
| Task |
Command |
Example |
| Show pool I/O stats |
zpool iostat |
zpool iostat -v tank 2 |
| Show ARC stats (FreeBSD) |
sysctl kstat.zfs.misc.arcstats |
sysctl kstat.zfs.misc.arcstats.size |
| Show ARC stats (Linux) |
arc_summary |
arc_summary or cat /proc/spl/kstat/zfs/arcstats |
| Check pool health |
zpool status -x |
zpool status -x (only shows problems) |
| Show pool events |
zpool events |
zpool events -v |
| Estimated scrub time |
zpool status |
zpool status (during scrub) |
| Show compression ratio |
zfs get compressratio |
zfs get compressratio tank/data |
| Show space usage by type |
zfs list -o space |
zfs list -r -o space tank |
Useful One-Liners
# Find largest datasets
zfs list -o name,used -s used
# Show all snapshots sorted by creation
zfs list -t snapshot -o name,creation -s creation
# Calculate total snapshot space
zfs list -t snapshot -o used -p | awk '{sum+=$1} END {print sum/1024/1024/1024 " GB"}'
# Show datasets with compression disabled
zfs get -r compression tank | grep -v "lz4\|gzip\|zle"
# Monitor pool I/O in real-time
zpool iostat -v 1
# Show properties that differ from defaults
zfs get all tank | grep -v default
# Quick backup to remote system
zfs snapshot tank/important@$(date +%Y%m%d) && \
zfs send tank/important@$(date +%Y%m%d) | ssh backup-server zfs receive tank/backup-2024
Quick Tips
- Device naming: FreeBSD uses different naming conventions (ada0 for SATA, da0 for SCSI/USB) vs Linux (sda, sdb, etc.)
- Network interfaces: FreeBSD names interfaces by driver (em0, re0, bge0) while Linux traditionally used eth0, eth1 (now often uses predictable names like enp0s3)
- Configuration files: FreeBSD centralizes many configs in
/etc/rc.conf while Linux distributes them across various files
- Manual pages: Both use
man command, but FreeBSD’s man pages are often more comprehensive
- Ports vs Packages: FreeBSD has both ports (source) and packages (binary), while Linux typically uses one package manager per distribution
- ZFS: While native to FreeBSD, ZFS on Linux (ZoL) has reached feature parity. Commands are identical, but kernel module loading differs (
kldload zfs on FreeBSD vs modprobe zfs on Linux)