Linux and macOS
Week of 2026-12-08 · Download .docx
Objectives
- Use fundamental Linux commands for file management and system administration
- Explain Linux file permissions and the chmod notation
- Compare macOS system tools to their Windows equivalents
Key terms
- ls -la
- Lists all files including hidden with permissions, owner, size, and date.
- chmod
- Linux command changing file/directory permissions using octal or symbolic notation.
- sudo
- Runs a command with superuser (root) privileges as defined in /etc/sudoers.
- apt
- Advanced Package Tool — Debian/Ubuntu package manager for installing software.
- dnf
- Package manager for Fedora and RHEL-based Linux distributions.
- grep
- Searches file contents for text patterns; supports regular expressions.
- top
- Interactive real-time process viewer showing CPU and memory usage per process.
- zsh
- Z shell — default shell in macOS since Catalina (2019); replaced bash.
- APFS
- Apple File System — macOS default since High Sierra (2017); optimized for SSDs.
- Homebrew
- Third-party macOS package manager — equivalent to apt on Ubuntu.
- / (root)
- Linux file system root — all drives and directories mount under this single point.
- rwxr-xr-x
- chmod 755 permission — owner can read/write/execute; group and others can read/execute.
The concept
LINUX FILE SYSTEM AND COMMANDS
Linux uses a single file system tree rooted at / (forward slash). Unlike Windows, which assigns drive letters (C:, D:), Linux mounts all storage — including external drives and network shares — as subdirectories under /. Home directories are at /home/username; configuration files are in /etc; binaries in /usr/bin.
Critical commands: 'ls' lists directory contents; add '-l' for long format (permissions + metadata) and '-a' for hidden files. 'cd' changes directory; 'pwd' prints the current path. 'grep pattern file' searches a file's contents for matching lines.
FILE PERMISSIONS
Linux permissions are shown as rwxrwxrwx — three groups of three characters for owner, group, and others. r=read (4), w=write (2), x=execute (1). Octal notation combines these: chmod 755 = owner rwx (7), group r-x (5), others r-x (5). chmod 644 = owner rw- (6), group r-- (4), others r-- (4) — standard for text files.
PACKAGE MANAGERS
Different Linux distributions use different package managers: Ubuntu/Debian use 'apt'; Fedora/RHEL use 'dnf'; Arch uses 'pacman'. On macOS, Homebrew ('brew install') fills the same role — installing command-line tools and GUI apps from a curated repository.
macOS SPECIFICS
The default macOS shell changed from bash to zsh with Catalina (2019). macOS uses APFS (Apple File System) as its default filesystem — optimized for SSDs with snapshot support and space sharing. The equivalent of Windows Task Manager is Activity Monitor; the equivalent of regedit is the Defaults system or property list (.plist) files. Homebrew is the de facto package manager for developer tools.
Worked examples
Common mistakes
- Using 'ls' instead of 'ls -la' — missing hidden files and permission details needed for troubleshooting.
- Confusing chmod 755 (rwxr-xr-x) with chmod 777 (rwxrwxrwx) — 777 grants everyone write access, a security risk.
- Running commands as root instead of using sudo — permanently running as root bypasses the safety of per-command elevation.
- Confusing 'su' (switch user) with 'sudo' — sudo runs one command elevated; 'su -' switches the full session.
- Attempting to use 'apt' on Fedora/RHEL or 'dnf' on Ubuntu — package managers are distribution-specific.
Self-check
Try each question before reading the answer. Answers at the bottom of this page.
1. 'ls -la' shows:
- All files including hidden with permissions, owner, size, date
- Only file names
- Only hidden files
- Directory contents only
2. chmod 755 sets permissions to:
- Owner: rwx; Group: r-x; Others: r-x
- Everyone: rwx
- Owner: rw-; Group: r--; Others: r--
- Owner: rwx; Group: rw-; Others: r--
3. Which command installs a package on Ubuntu?
- sudo apt install <package>
- sudo dnf install <package>
- sudo yum install <package>
- sudo pacman -S <package>
4. macOS Terminal uses which default shell?
- zsh
- bash
- sh
- fish
5. The Linux file system root is mounted at:
- / (forward slash)
- C:\
- \root
- drive:
Self-check answers
- 1. A — -l adds long format metadata; -a adds hidden files (starting with dot).
- 2. A — 755 = owner 7 (rwx), group 5 (r-x), others 5 (r-x).
- 3. A — apt (Advanced Package Tool) is the package manager for Debian/Ubuntu Linux.
- 4. A — macOS switched from bash to zsh as the default shell starting with Catalina (2019).
- 5. A — All Linux directories and mounts exist under the single root at / (forward slash).
Canvas is the official record. This companion enhances the PGCC curriculum; it does not replace it. Last name and class year only. Students with a 504 plan or IEP: your accommodations apply.