Introduction to the Command Line
What is the Command Line?
The terminal, shell, and command line — what each term means and how they relate.
Why developers use the CLI: speed, automation, remote access, and tool availability.
A tour of the most common shells: bash, zsh, and Windows PowerShell.
Opening a terminal on macOS (Terminal / iTerm2), Linux, and Windows (WSL2 recommended).
Start
Navigating the File System
The directory tree: root (/), home (~), absolute paths, and relative paths.
Essential navigation commands: pwd, ls, cd, and tree.
Useful ls flags: -l (long format), -a (hidden files), and -h (human-readable sizes).
Tab completion and command history (up arrow, Ctrl+R) for faster navigation.
Start
Files and Directories
Creating files and directories: touch, mkdir, and mkdir -p for nested paths.
Copying, moving, and renaming: cp, mv, and their common flags.
Deleting files and directories: rm, rm -r, and rmdir — and why to be careful with rm -rf.
Viewing file contents: cat, less, head, and tail.
Start
Working with Text
Searching inside files with grep: basic patterns, -i (case-insensitive), -r (recursive), and -n (line numbers).
Filtering and transforming output with pipes (|) and redirection (>, >>, <).
Counting lines, words, and characters with wc.
Sorting and deduplicating with sort and uniq.
A practical workflow: finding all TODO comments in a codebase with grep.
Start
Permissions and Users
Unix file permissions: read (r), write (w), and execute (x) for owner, group, and others.
Reading permission strings: -rwxr-xr-- and octal notation (755, 644).
Changing permissions with chmod and ownership with chown.
The sudo command — running commands as root and why it should be used sparingly.
Why file permissions matter for security in a web server context.
Start
Processes and System Info
What a process is: PID, parent/child relationships, and foreground vs background.
Listing processes with ps aux and top / htop.
Running commands in the background with & and bringing them back to the foreground with fg.
Stopping processes: Ctrl+C (interrupt), Ctrl+Z (suspend), kill, and kill -9.
Useful system commands: df (disk space), du (directory size), free (memory), and uname.
Start
Environment Variables
What environment variables are and how programs use them for configuration.
Reading and setting variables: echo $VAR, export VAR=value, and .env files.
The PATH variable: how the shell finds commands and how to add a directory to it.
Shell configuration files: ~/.bashrc, ~/.zshrc, and ~/.profile — what goes where.
Creating and using aliases to shorten common commands.
Start
Shell Scripting Basics
Writing a first shell script: the shebang line (#!/bin/bash), making a file executable with chmod +x, and running it.
Variables, quoting rules (single vs double quotes), and command substitution ($()).
Conditionals: if / elif / else and common test operators ([ -f file ], [ $a -eq $b ]).
Loops: for and while over files and command output.
Practical scripts: a project setup script, a backup script, and a batch file renamer.
Start
Package Managers
System package managers: apt (Debian/Ubuntu), brew (macOS), and winget (Windows).
Installing, updating, and removing packages — keeping a system clean.
Node.js package managers: npm, yarn, and pnpm — when and why to use each.
Global vs local installs and the node_modules folder.
npx for running packages without installing them globally.
Start
SSH and Remote Servers
What SSH is and how public-key authentication works: generating an RSA/Ed25519 key pair with ssh-keygen.
Connecting to a remote server with ssh user@host and copying files with scp and rsync.
The ~/.ssh/config file for managing multiple servers and aliases.
Running long-lived processes on a remote server with tmux or screen.
A practical walkthrough: deploying a Node.js app to a Linux VPS.
Start
CLI Tools Every Developer Uses
Text editors in the terminal: nano for beginners, vim basics (open, edit, save, quit).
curl and wget for making HTTP requests and downloading files from the command line.
jq for parsing and querying JSON responses in scripts.
diff and patch for comparing files and applying changes.
An overview of modern CLI replacements: fd (find), ripgrep (grep), bat (cat), and exa (ls).
Start
Putting It All Together
A capstone project: writing a shell script that automates a real developer workflow — cloning a repo, installing dependencies, running tests, and deploying.
Combining pipes, variables, conditionals, and loops into a maintainable script.
Debugging scripts: set -e (exit on error), set -x (trace execution), and error messages.
Recommended dotfiles setup and resources for building a productive terminal environment.
Start
