HxHippy

FreeBSD vs Linux: Key Differences

Essential differences between FreeBSD and Linux for sysadmins transitioning to BSD.

Last updated: 2025-01-15

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 status

Configuration

# FreeBSD - all startup config in one place
cat /etc/rc.conf

# Enable a service
sysrc sshd_enable="YES"

# View current settings
sysrc -a

Networking 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 restart

User 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 line

Why Choose FreeBSD?

  1. ZFS Native Support - Best-in-class filesystem with snapshots, compression, deduplication
  2. Jails - Lightweight containerization predating Docker
  3. Stability - Complete system tested together
  4. Documentation - Exceptional official handbook
  5. Ports Collection - Build software with custom options
  6. License - Permissive BSD license
  7. Security - Capsicum capability framework, pledge
beginner Getting Started Updated 2025-01-15
  • freebsd
  • linux
  • differences
  • comparison
  • bsd
  • unix