macOS & Linux Basics

Key Takeaways

  • macOS uses the APFS (Apple File System) by default, supports Time Machine for automatic backups, and uses Spotlight (Cmd+Space) for universal search.
  • Linux uses a hierarchical file system starting from / (root), with key directories including /home (user files), /etc (configuration), /var (logs), /tmp (temporary), and /bin (essential binaries).
  • Essential Linux commands: ls (list), cd (change directory), cp (copy), mv (move), rm (remove), chmod (change permissions), chown (change ownership), grep (search text), sudo (run as root).
  • Linux file permissions use a three-digit octal notation (e.g., 755): Owner-Group-Other, where 4=read, 2=write, 1=execute (add values for combined permissions).
  • Common Linux package managers include apt (Debian/Ubuntu), yum/dnf (Red Hat/Fedora), and pacman (Arch) — used to install, update, and remove software packages.
Last updated: March 2026

macOS & Linux Basics

macOS Essentials

Key macOS Features

FeatureDescription
FinderFile manager (equivalent to Windows File Explorer)
SpotlightUniversal search (Cmd + Space) for files, apps, calculations
Time MachineAutomatic incremental backups to external drive
Mission ControlOverview of all open windows and virtual desktops (Spaces)
KeychainPassword and certificate management system
FileVaultFull-disk encryption (equivalent to BitLocker)
TerminalCommand-line interface (uses zsh shell by default)
AirDropPeer-to-peer file sharing between Apple devices
System Preferences/SettingsCentral configuration panel (equivalent to Control Panel)

macOS File System

  • APFS (Apple File System) — Default since macOS High Sierra (2017)
  • Supports encryption, snapshots, space sharing, and crash protection
  • Previous format: HFS+ (Mac OS Extended)

macOS Keyboard Shortcuts

ShortcutAction
Cmd + SpaceOpen Spotlight search
Cmd + QQuit application
Cmd + WClose window
Cmd + C / V / XCopy / Paste / Cut
Cmd + ZUndo
Cmd + TabSwitch between applications
Cmd + Option + EscForce quit application (like Ctrl+Alt+Del)

Linux Essentials

Linux File System Hierarchy

DirectoryContents
/Root directory (top of hierarchy)
/homeUser home directories (/home/username)
/etcSystem configuration files
/varVariable data: logs (/var/log), mail, spool
/tmpTemporary files (cleared on reboot)
/binEssential user binaries (ls, cp, mv)
/sbinSystem binaries (ifconfig, reboot, fdisk)
/usrUser programs and libraries
/optOptional/third-party software
/devDevice files (hard drives, terminals)
/procVirtual filesystem for process and system info
/bootBoot loader files (kernel, GRUB)
/rootRoot user's home directory
/mntTemporary mount points
/mediaRemovable media mount points

Essential Linux Commands

CommandPurposeExample
lsList directory contentsls -la (detailed with hidden files)
cdChange directorycd /var/log
pwdPrint working directorypwd → /home/user
cpCopy filescp file.txt /backup/
mvMove or rename filesmv old.txt new.txt
rmRemove filesrm file.txt, rm -rf directory/
mkdirCreate directorymkdir /home/user/projects
catDisplay file contentscat /etc/hostname
nano / viText editorsnano config.txt, vi config.txt
grepSearch text in filesgrep "error" /var/log/syslog
findFind filesfind / -name "*.log"
sudoRun command as rootsudo apt update
suSwitch usersu - root
chmodChange file permissionschmod 755 script.sh
chownChange file ownershipchown user:group file.txt
dfDisplay disk space usagedf -h (human-readable)
top / htopDisplay running processestop (live process monitor)
psList processesps aux (all processes)
killTerminate a processkill -9 PID
apt / yum / dnfPackage managementsudo apt install package-name
manDisplay manual pagesman chmod
ip addrDisplay IP configurationip addr show
pingTest connectivityping 8.8.8.8

Linux File Permissions

Permissions are displayed as: -rwxrwxrwx (type + owner + group + other)

SymbolValuePermission
r4Read
w2Write
x1Execute
-0No permission

Octal Notation Examples

OctalPermissionsMeaning
777rwxrwxrwxFull access for everyone (insecure)
755rwxr-xr-xOwner: full; Group/Other: read+execute
644rw-r--r--Owner: read+write; Group/Other: read only
700rwx------Owner only: full access
600rw-------Owner only: read+write

Permission Commands

chmod 755 script.sh    # Set permissions using octal
chmod u+x script.sh    # Add execute for owner
chmod g-w file.txt     # Remove write for group
chown alice:staff file.txt   # Change owner to alice, group to staff

Package Management

DistributionPackage ManagerInstall Command
Debian/Ubuntuapt (apt-get)sudo apt install package
Red Hat/Fedora/CentOSyum / dnfsudo dnf install package
Arch Linuxpacmansudo pacman -S package
SUSEzyppersudo zypper install package

Common apt operations:

  • sudo apt update — Refresh package lists
  • sudo apt upgrade — Upgrade all installed packages
  • sudo apt install package — Install a package
  • sudo apt remove package — Remove a package
Test Your Knowledge

What is the macOS equivalent of Windows BitLocker for full-disk encryption?

A
B
C
D
Test Your Knowledge

In Linux, what permission is represented by the octal value 755?

A
B
C
D
Test Your Knowledge

Which Linux directory contains system configuration files?

A
B
C
D
Test Your KnowledgeFill in the Blank

The Linux command to search for a specific text pattern within files is: _____

Type your answer below