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
| Feature | Description |
|---|---|
| Finder | File manager (equivalent to Windows File Explorer) |
| Spotlight | Universal search (Cmd + Space) for files, apps, calculations |
| Time Machine | Automatic incremental backups to external drive |
| Mission Control | Overview of all open windows and virtual desktops (Spaces) |
| Keychain | Password and certificate management system |
| FileVault | Full-disk encryption (equivalent to BitLocker) |
| Terminal | Command-line interface (uses zsh shell by default) |
| AirDrop | Peer-to-peer file sharing between Apple devices |
| System Preferences/Settings | Central 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
| Shortcut | Action |
|---|---|
| Cmd + Space | Open Spotlight search |
| Cmd + Q | Quit application |
| Cmd + W | Close window |
| Cmd + C / V / X | Copy / Paste / Cut |
| Cmd + Z | Undo |
| Cmd + Tab | Switch between applications |
| Cmd + Option + Esc | Force quit application (like Ctrl+Alt+Del) |
Linux Essentials
Linux File System Hierarchy
| Directory | Contents |
|---|---|
| / | Root directory (top of hierarchy) |
| /home | User home directories (/home/username) |
| /etc | System configuration files |
| /var | Variable data: logs (/var/log), mail, spool |
| /tmp | Temporary files (cleared on reboot) |
| /bin | Essential user binaries (ls, cp, mv) |
| /sbin | System binaries (ifconfig, reboot, fdisk) |
| /usr | User programs and libraries |
| /opt | Optional/third-party software |
| /dev | Device files (hard drives, terminals) |
| /proc | Virtual filesystem for process and system info |
| /boot | Boot loader files (kernel, GRUB) |
| /root | Root user's home directory |
| /mnt | Temporary mount points |
| /media | Removable media mount points |
Essential Linux Commands
| Command | Purpose | Example |
|---|---|---|
| ls | List directory contents | ls -la (detailed with hidden files) |
| cd | Change directory | cd /var/log |
| pwd | Print working directory | pwd → /home/user |
| cp | Copy files | cp file.txt /backup/ |
| mv | Move or rename files | mv old.txt new.txt |
| rm | Remove files | rm file.txt, rm -rf directory/ |
| mkdir | Create directory | mkdir /home/user/projects |
| cat | Display file contents | cat /etc/hostname |
| nano / vi | Text editors | nano config.txt, vi config.txt |
| grep | Search text in files | grep "error" /var/log/syslog |
| find | Find files | find / -name "*.log" |
| sudo | Run command as root | sudo apt update |
| su | Switch user | su - root |
| chmod | Change file permissions | chmod 755 script.sh |
| chown | Change file ownership | chown user:group file.txt |
| df | Display disk space usage | df -h (human-readable) |
| top / htop | Display running processes | top (live process monitor) |
| ps | List processes | ps aux (all processes) |
| kill | Terminate a process | kill -9 PID |
| apt / yum / dnf | Package management | sudo apt install package-name |
| man | Display manual pages | man chmod |
| ip addr | Display IP configuration | ip addr show |
| ping | Test connectivity | ping 8.8.8.8 |
Linux File Permissions
Permissions are displayed as: -rwxrwxrwx (type + owner + group + other)
| Symbol | Value | Permission |
|---|---|---|
| r | 4 | Read |
| w | 2 | Write |
| x | 1 | Execute |
| - | 0 | No permission |
Octal Notation Examples
| Octal | Permissions | Meaning |
|---|---|---|
| 777 | rwxrwxrwx | Full access for everyone (insecure) |
| 755 | rwxr-xr-x | Owner: full; Group/Other: read+execute |
| 644 | rw-r--r-- | Owner: read+write; Group/Other: read only |
| 700 | rwx------ | Owner only: full access |
| 600 | rw------- | 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
| Distribution | Package Manager | Install Command |
|---|---|---|
| Debian/Ubuntu | apt (apt-get) | sudo apt install package |
| Red Hat/Fedora/CentOS | yum / dnf | sudo dnf install package |
| Arch Linux | pacman | sudo pacman -S package |
| SUSE | zypper | sudo zypper install package |
Common apt operations:
sudo apt update— Refresh package listssudo apt upgrade— Upgrade all installed packagessudo apt install package— Install a packagesudo 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