Overview
FreeBSD and Linux share Unix heritage but differ significantly in philosophy, structure, and tooling. Understanding these differences is crucial for effective FreeBSD administration.
Base System vs Distributions
Linux
- Kernel + userland from different projects
- Each distribution packages differently
- Package managers vary (apt, yum, pacman)
- Init systems vary (systemd, OpenRC, runit)
FreeBSD
- Complete operating system developed as one project
- Base system is consistent across all installations
- Single package manager (pkg)
- Single init system (rc.d)
Key Command Differences
| Task | Linux | FreeBSD |
|---|---|---|
| Network config | ip addr |
ifconfig |
| Service management | systemctl |
service / sysrc |
| Disk info | lsblk |
geom disk list |
| View processes | ps aux |
ps aux (same) |
| Package install | apt install |
pkg install |
| Edit startup | /etc/systemd/ |
/etc/rc.conf |
File System Locations
# FreeBSD directory structure
/ - Root filesystem
/bin - Essential user commands
/boot - Boot loader files
/etc - System configuration
/home - User home directories (often symlink to /usr/home)
/lib - Essential shared libraries
/libexec - System daemons
/mnt - Mount points
/root - Root user home
/sbin - Essential system binaries
/tmp - Temporary files
/usr - User utilities and applications
/usr/local - Third-party applications (pkg installs here)
/var - Variable data (logs, mail, etc.)Service Management
Starting/Stopping Services
# Linux (systemd)
systemctl start nginx
systemctl enable nginx
systemctl status nginx
# FreeBSD
service nginx start
sysrc nginx_enable="YES"
service nginx statusConfiguration
# FreeBSD - all startup config in one place
cat /etc/rc.conf
# Enable a service
sysrc sshd_enable="YES"
# View current settings
sysrc -aNetworking Differences
# FreeBSD network configuration
# Static IP in /etc/rc.conf:
ifconfig_em0="inet 192.168.1.100 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
# View interfaces
ifconfig
# Restart networking
service netif restart
service routing restartUser Management
# Add user (interactive)
adduser
# Add user to group
pw groupmod wheel -m username
# FreeBSD uses 'wheel' group for sudo access (like Linux)
# Install sudo:
pkg install sudo
visudo # uncomment wheel group lineWhy Choose FreeBSD?
- ZFS Native Support - Best-in-class filesystem with snapshots, compression, deduplication
- Jails - Lightweight containerization predating Docker
- Stability - Complete system tested together
- Documentation - Exceptional official handbook
- Ports Collection - Build software with custom options
- License - Permissive BSD license
- Security - Capsicum capability framework, pledge
- freebsd
- linux
- differences
- comparison
- bsd
- unix