The command line (also known as shell, terminal, or CLI) is a text-based interface where users interact with their operating system by typing commands. Originating from Unix in the 1970s, it remains the most efficient way to automate tasks, manage systems, and perform complex operations that would be cumbersome with graphical interfaces. While graphical UIs are intuitive for beginners, the command line offers unmatched power through composability β the ability to chain simple commands into sophisticated workflows using pipes and redirection. Mastering command line fundamentals means understanding not just individual commands, but how they communicate through streams (stdin, stdout, stderr), enabling you to build pipelines where each tool does one thing well and passes its output to the next.
What This Cheat Sheet Covers
This topic spans 26 focused tables and 239 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Directory Navigation
Navigating the filesystem fluently is the first skill any CLI user must internalize. pwd, cd, and ls form the absolute core; pushd/popd add a directory stack so you can jump between multiple locations without retyping paths β essential in long sessions involving many directories.
| Command | Example | Description |
|---|---|---|
cd /var/log | β’ Change directory β’ ~ = home, - = previous dir, .. = parent | |
ls -lah | β’ List directory contents β’ -l long format, -a hidden files, -h human-readable sizes | |
pwd | Print absolute path of current working directory | |
pushd /var/log | β’ Change to directory and push it onto the directory stack β’ returns to it with popd |