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.
/ - 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/ - 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| 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 |
| 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 |
| 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 |
rwxr-xr-x = Read/Write/Execute for owner, Read/Execute for group, Read/Execute for others755 = Owner(7=rwx), Group(5=rx), Others(5=rx)
brew install pkgapt install pkgdnf install pkgpacman -S pkgbrew listapt list --installeddnf list installedpacman -Qbrew search keywordapt search keyworddnf search keywordpacman -Ss keywordbrew updateapt updatednf check-updatepacman -Sybrew upgradeapt upgradednf upgradepacman -Syubrew uninstall pkgapt remove pkgdnf remove pkgpacman -R pkgbrew info pkgapt show pkgdnf info pkgpacman -Si pkglaunchctl load ~/Library/LaunchAgents/service.plist - Load servicelaunchctl unload ~/Library/LaunchAgents/service.plist - Unload servicelaunchctl list - List running serviceslaunchctl start service - Start servicelaunchctl stop service - Stop service.plist XML files in /Library/LaunchDaemons or ~/Library/LaunchAgentssystemctl start service - Start servicesystemctl stop service - Stop servicesystemctl restart service - Restart servicesystemctl enable service - Enable at bootsystemctl disable service - Disable at bootsystemctl status service - Check service statussystemctl list-units --type=service - List all services.service files in /etc/systemd/system/ or /lib/systemd/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.