StayTalentReady

Linux and macOS

Week of 2026-12-08 · Download .docx

Objectives

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

Example 1: A new Ubuntu server needs Node.js installed. Commands: 'sudo apt update' (refresh package list), then 'sudo apt install nodejs npm'. Verify with 'node --version'. On Fedora: 'sudo dnf install nodejs'. The package manager handles dependency resolution automatically.
Example 2: A file named deploy.sh needs to be executable by the owner but readable only by group and others. Correct permission: chmod 744 (owner: rwx=7, group: r--=4, others: r--=4). Verify with 'ls -la deploy.sh' which should show '-rwxr--r--'.

Common mistakes

Self-check

Try each question before reading the answer. Answers at the bottom of this page.

1. 'ls -la' shows:

  1. All files including hidden with permissions, owner, size, date
  2. Only file names
  3. Only hidden files
  4. Directory contents only

2. chmod 755 sets permissions to:

  1. Owner: rwx; Group: r-x; Others: r-x
  2. Everyone: rwx
  3. Owner: rw-; Group: r--; Others: r--
  4. Owner: rwx; Group: rw-; Others: r--

3. Which command installs a package on Ubuntu?

  1. sudo apt install <package>
  2. sudo dnf install <package>
  3. sudo yum install <package>
  4. sudo pacman -S <package>

4. macOS Terminal uses which default shell?

  1. zsh
  2. bash
  3. sh
  4. fish

5. The Linux file system root is mounted at:

  1. / (forward slash)
  2. C:\
  3. \root
  4. drive:

Self-check answers

  1. 1. A — -l adds long format metadata; -a adds hidden files (starting with dot).
  2. 2. A — 755 = owner 7 (rwx), group 5 (r-x), others 5 (r-x).
  3. 3. A — apt (Advanced Package Tool) is the package manager for Debian/Ubuntu Linux.
  4. 4. A — macOS switched from bash to zsh as the default shell starting with Catalina (2019).
  5. 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.

↑ Back to top