Back to Chapter 17

OS Reference Card

macOS & Linux Quick Reference for CompTIA A+ Core 2

A comprehensive side-by-side comparison of macOS and Linux commands, file systems, and administration tasks. Perfect for A+ exam preparation and real-world IT support scenarios.

File System Structure

macOS (APFS - Apple File System)
  • / - Root directory
  • /Applications - Installed applications
  • /Users - User home directories
  • /Library - System-wide settings and resources
  • /System - Core OS files (protected)
  • /Volumes - Mounted drives and partitions
  • /private - System configuration files
Linux (ext4, XFS, Btrfs)
  • / - Root directory
  • /home - User home directories
  • /etc - Configuration files
  • /var - Variable data (logs, caches)
  • /usr - User programs and utilities
  • /bin - Essential user binaries
  • /tmp - Temporary files
  • /boot - Boot loader files
  • /dev - Device files
  • /proc - Process and kernel information

Navigation & File Commands

Task macOS Linux
List files ls, ls -la ls, ls -la
Change directory cd /path cd /path
Current directory pwd pwd
Copy files cp source dest cp source dest
Move/rename mv old new mv old new
Delete file rm file rm file
Create directory mkdir dirname mkdir dirname
View file cat file, less file cat file, less file
Change permissions chmod 755 file chmod 755 file
Change ownership chown user:group chown user:group
Find files find /path -name, mdfind find /path -name, locate
Search text in files grep "text" file grep "text" file

System Information

Task macOS Linux
CPU information system_profiler SPHardwareDataType lscpu, cat /proc/cpuinfo
Memory information system_profiler SPHardwareDataType free -h, cat /proc/meminfo
Disk space df -h df -h
Disk usage du -sh * du -sh *
Running processes top, Activity Monitor top, htop, ps aux
OS version sw_vers cat /etc/os-release, uname -a
Network interfaces ifconfig, networksetup ip addr, ifconfig, nmcli
Hostname hostname, scutil --get ComputerName hostname, hostnamectl
Uptime uptime uptime

User & Permission Management

Task macOS Linux
Current user whoami whoami
List all users dscl . list /Users cat /etc/passwd
Add user sysadminctl -addUser username useradd username, adduser username
Delete user sysadminctl -deleteUser username userdel username
Change password passwd passwd
Run as superuser sudo command sudo command
Switch user su username su username
File permissions chmod 755 file (rwxr-xr-x) chmod 755 file (rwxr-xr-x)
Change ownership chown user:group file chown user:group file
View permissions ls -l ls -l
Permission Format (Both Systems)
rwxr-xr-x = Read/Write/Execute for owner, Read/Execute for group, Read/Execute for others
Numeric: 755 = Owner(7=rwx), Group(5=rx), Others(5=rx)

Package Management

macOS (Homebrew)
Debian/Ubuntu (APT)
RHEL/Fedora (DNF/YUM)
Arch (Pacman)
Install package
brew install pkg
apt install pkg
dnf install pkg
pacman -S pkg
List installed
brew list
apt list --installed
dnf list installed
pacman -Q
Search packages
brew search keyword
apt search keyword
dnf search keyword
pacman -Ss keyword
Update repository
brew update
apt update
dnf check-update
pacman -Sy
Upgrade packages
brew upgrade
apt upgrade
dnf upgrade
pacman -Syu
Remove package
brew uninstall pkg
apt remove pkg
dnf remove pkg
pacman -R pkg
Package info
brew info pkg
apt show pkg
dnf info pkg
pacman -Si pkg
Important Note
Homebrew is third-party software for macOS. Native macOS apps typically install via .dmg files or App Store. Linux package managers are built into the OS and are the primary method for software installation.

Service Management

macOS (launchd / launchctl)
  • launchctl load ~/Library/LaunchAgents/service.plist - Load service
  • launchctl unload ~/Library/LaunchAgents/service.plist - Unload service
  • launchctl list - List running services
  • launchctl start service - Start service
  • launchctl stop service - Stop service
  • Service files: .plist XML files in /Library/LaunchDaemons or ~/Library/LaunchAgents
Linux (systemd / systemctl)
  • systemctl start service - Start service
  • systemctl stop service - Stop service
  • systemctl restart service - Restart service
  • systemctl enable service - Enable at boot
  • systemctl disable service - Disable at boot
  • systemctl status service - Check service status
  • systemctl list-units --type=service - List all services
  • Service files: .service files in /etc/systemd/system/ or /lib/systemd/system/

Key Differences for A+ Exam

File Systems
macOS: APFS (Apple File System) - optimized for SSDs, snapshots, encryption
Linux: ext4 (most common), XFS, Btrfs - variety of options depending on distribution
Software Installation
macOS: .dmg disk images, App Store, or Homebrew (third-party)
Linux: Package managers (apt, dnf, pacman) are the primary method - native to OS
Unix Heritage
Both macOS and Linux share Unix origins and are POSIX-compliant. Many commands work identically on both systems. macOS is based on Darwin (BSD Unix), while Linux uses the Linux kernel.
Distribution Model
macOS: Single vendor (Apple), proprietary, uniform experience
Linux: Multiple distributions (Ubuntu, Fedora, RHEL, Debian, Arch), open source, varied experiences
Terminal Access
Both provide CLI access through Terminal applications. Shell environments (bash, zsh, fish) work on both platforms. macOS default shell changed from bash to zsh in Catalina (10.15).
Permissions System
chmod and chown work identically on both systems. Both use the same rwx (read/write/execute) permission model. Numeric notation (755, 644, etc.) is universal.

Common A+ Exam Scenarios

Which command shows disk usage on both macOS and Linux?
df -h
How do you change file permissions on both systems?
chmod (e.g., chmod 755 file)
Where are configuration files stored on Linux?
/etc directory
Where are applications installed on macOS?
/Applications directory
How do you install software on Ubuntu?
apt install packagename
How do you view running processes on both systems?
top or ps aux
What command runs a command as superuser?
sudo command
What does chmod 644 mean?
rw-r--r-- (owner read/write, others read)
How do you search for text in files?
grep "search" filename
What is the Linux equivalent of macOS's .dmg files?
Package manager (apt/dnf/pacman)
Which service manager does modern Linux use?
systemd (systemctl)
What file system does macOS use?
APFS (Apple File System)
What file system does Linux commonly use?
ext4 (also XFS, Btrfs)
How do you view the current user?
whoami
How do you check network interfaces on Linux?
ip addr or ifconfig
What command shows OS version on macOS?
sw_vers
Pro Tip
For the A+ exam, focus on understanding the similarities between macOS and Linux (Unix heritage, similar commands) and the key differences (file systems, package management, service control). Many commands are identical or nearly identical. Use this reference card to quickly look up commands and compare approaches across both operating systems.