The Shell
The shell (also called the command line or terminal) lets you talk to your computer by typing commands instead of clicking. We use it to run Git, launch R and Quarto, and move around the file system.
Opening a shell
macOS — Terminal
- Press ⌘ + Space to open Spotlight.
- Type
Terminaland press Return.
Terminal comes preinstalled on every Mac.
Windows — Git Bash
Windows has several shells, but for this course use Git Bash, which behaves like the macOS/Linux shell.
- Install Git for Windows (this also gives you Git Bash).
- Open the Start menu, type
Git Bash, and press Enter.
A few starter commands
| Command | What it does |
|---|---|
pwd |
Print the current (working) directory |
ls |
List files in the current directory |
cd folder |
Change into folder |
cd .. |
Move up one directory |
cat |
Prints the contents of a file |
Tips
- Press Tab to autocomplete file and folder names.
- Press the Up arrow to recall previous commands.
- Paths are case-sensitive on the shell —
Dataanddataare different.