Getting Started with the Terminal
What you'll learn
- •Understand what a shell is and why it matters
- •Open and navigate your terminal application
- •Run your first commands
- •Understand command structure and arguments
What Is a Shell?
A shell is a program that interprets your commands and communicates with the operating system. When you open a terminal, you're interacting with a shell.
The most common shells are:
- Bash (Bourne Again Shell) - The default on most Linux systems
- Zsh - The default on macOS (since Catalina)
- Fish - A modern, user-friendly alternative
For this course, we'll focus on concepts that work across all shells.
Your First Commands
Let's start with the basics. Open your terminal and try these:
whoami
This displays your username. Simple, but it confirms your terminal is working.
date
Shows the current date and time. Notice how commands just... run? No clicking, no menus.
echo "Hello, Unix!"
The echo command prints text to the screen. We'll use this a lot for debugging and scripting.
Understanding Command Structure
Unix commands follow a consistent pattern:
command [options] [arguments]
Let's break this down:
- command - The program you want to run (e.g.,
ls,cat,grep) - options - Modify how the command behaves (usually start with
-or--) - arguments - What the command operates on (files, directories, text)
Example: The ls Command
ls
Lists files in the current directory.
ls -l
The -l option shows a "long" format with details like permissions, size, and dates.
ls -la /home
Here we combine options (-l and -a for "all", including hidden files) and provide an argument (/home directory).
Tip
The Manual Pages
Unix has built-in documentation called "man pages" (short for manual):
man ls
This opens the full documentation for ls. Use arrow keys to scroll, and press q to quit.
Note
Practice Exercise
Try these commands and observe the output:
- Run
pwd- What does it show? - Run
ls -lain your home directory - Run
man echoand find out what the-noption does
Key Takeaways
- The shell is your interface to the operating system
- Commands follow the pattern:
command [options] [arguments] - Use
--helpormanto learn about any command - Practice is the only way to get comfortable
In the next lesson, we'll dive into navigating the filesystem.
Lesson 1 of 2