P-TECH IT

Linux and macOS

Lesson 13 · Linux and macOS · 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 one before you look. A miss here costs nothing and tells you exactly what to reread.

1. 'ls -la' shows:
2. chmod 755 sets permissions to:
3. Which command installs a package on Ubuntu?
4. macOS Terminal uses which default shell?
5. The Linux file system root is mounted at:

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.

← Windows Administration ToolsSecurity Concepts and Threats →

↑ Back to top