CIS120 Linux Fundamentals by Scott Shaper

The Terminal and Shell

When you use a computer, you usually point and click: you open apps from a menu, drag files into folders, and type in word processors. But there is another way to work—by typing text commands into a terminal. The terminal is the window or application where you type those commands. The shell is the program that reads what you type, interprets it, and runs the right actions. Think of the terminal as the keyboard and screen you use to talk to the computer, and the shell as the “translator” that turns your words into things the computer does. Learning to use the terminal and shell will give you more control and is essential for programming, working on servers, and using many development tools.

Terminal vs. Shell: What's the Difference?

It's easy to mix these up, but they refer to different parts of the same workflow:

Term What It Is Analogy
Terminal The application or window where you type and see output The keyboard and monitor you use to interact
Shell The program that reads your commands and runs them The translator between you and the operating system

When you "open a terminal," you're really opening an app that runs a shell. You type a command, press Enter, and the shell runs it and shows you the result.

Why Use the Terminal?

You might use the terminal when:

The Command Line and the Prompt

When you open a terminal, you see a line of text that usually ends with a symbol such as $ or %. That line is called the prompt. It means "the shell is ready for your next command." You type a command and press Enter to run it.

$ pwd
/home/student
$

Here, pwd is the command (it prints your current folder). The line below is the output, and then you get a new prompt. Everything happens one command at a time.

Prompt Format

Prompts can look different on different systems. Common patterns:

Prompt Meaning
$ Normal user (Bash-style)
% Normal user (some shells, e.g. Zsh)
# Often indicates root or administrator
username@hostname:~$ Shows your username, computer name, and current directory

In this course we'll often show just $ before a command. You type only what comes after the $; don't type the $ itself.

Common Shells

Different shells have slightly different features and syntax. The ideas in this course apply to all of them; we'll use Bash-style examples.

Shell Description Common On
bash Bourne Again Shell; very common, good for learning Linux, macOS (older), Git Bash on Windows
zsh Z Shell; default on newer macOS, many extras macOS (default)
sh Generic "shell"; often points to bash or another shell Many Unix-like systems

To see which shell you're using, you can run:

echo $SHELL

Output might be /bin/bash or /bin/zsh, for example.

Basic Interaction

Every time you use the terminal, you're doing the same basic loop:

  1. Read the prompt.
  2. Type a command (and any options or arguments).
  3. Press Enter.
  4. Read the output (or any error message).
  5. Repeat.

Your First Commands

Try these to get a feel for the terminal. After each line, press Enter. We will look at these commands in more detail in later lessons.

# Show current directory
pwd

# List files and folders here
ls

# Show which shell is running
echo $SHELL

Tips for Success

Common Mistakes to Avoid