STAT 133
  1. Tools
  2. Shell
  • Home
  • Syllabus
  • Office Hours

  • Tools
    • DataHub
    • Shell
    • R

  • Problem Sets
    • PS 1
  1. Tools
  2. Shell

The Shell

Shell logo

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

  1. Press ⌘ + Space to open Spotlight.
  2. Type Terminal and 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.

  1. Install Git for Windows (this also gives you Git Bash).
  2. 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 — Data and data are different.