Hello, Shell!
What a shell is, how to open a terminal, and your first real commands — echo, pwd, ls, and whoami.
- Explain what a shell is and why it matters
- Open a terminal on your operating system
- Run echo, pwd, ls, and whoami successfully
- Read a basic shell error message without panic
There's a program running on your computer right now that almost no one teaches you about, even though every developer uses it every day. It's called a shell, and once you know it, you'll wonder how you ever worked without it.
What is a shell?
A shell is a program that takes text commands and runs other programs. You type ls, press Enter, and the shell finds the ls program, runs it, and shows you the output. That's it — the core idea is that simple.
What makes it powerful is composition. The shell can connect programs together, redirect their output to files, loop over lists, and make decisions — all with short, readable syntax. That's why it's the universal interface: it was designed to glue everything else together.
Why Bash specifically? Bash (Bourne Again SHell) ships with macOS and almost every Linux distribution. When AI agents, CI pipelines, Docker containers, or cloud servers run shell commands, they almost always use Bash or something compatible. Learning it is as close to future-proof as computing gets.
Opening a terminal
How you get a terminal depends on your OS:
- macOS — press
Cmd+Space, type "Terminal", press Enter. Or install iTerm2 for a better experience. - Linux — look for "Terminal" in your application menu, or press
Ctrl+Alt+Ton most distributions. - Windows — install Windows Subsystem for Linux (WSL) and use the Ubuntu terminal it provides. PowerShell is not Bash and works differently.
When the terminal opens, you'll see a prompt — usually something like user@hostname:~$. Everything before the $ is metadata. The $ is the shell asking: what do you want to do?
Your first four commands
Type these commands one at a time. Press Enter after each one.
whoamiPrints your username. Simple and useful — especially later when you're working on remote servers and need to confirm which account you're using.
pwd"Print Working Directory." Shows the full path of the folder you're currently in. The shell always has a current directory — this tells you where you are.
ls"List." Shows the files and folders in the current directory. This is one of the commands you'll run hundreds of times per day.
echo "Hello, shell!"echo repeats whatever you give it. It looks trivial now, but it's the foundation of shell scripts — you'll use it to print messages, inspect variables, and debug scripts. When echo runs, its output goes to stdout — the standard output stream — which is why you see the result in your terminal.
When the agent's away: AI coding agents use these exact commands to navigate your project. When an agent says "let me check what's in this directory," it's running ls. When it prints a diagnostic message, it's using echo. You're learning the same vocabulary.
Reading an error message
Make a deliberate mistake — type a command that doesn't exist:
heloYou'll see something like:
bash: helo: command not foundThe shell always tells you the name of the program it couldn't find. This is the most common error you'll see as a beginner. Check your spelling and try again. The shell is not judging you — it's giving you exactly the information you need.
Check your understanding
- 1.What does a shell primarily do?
- 2.What does the pwd command print?
- 3.A "command not found" error means your computer is broken.
Do it yourself
Open your terminal and run all four commands in sequence. Type them — don't paste:
whoami
pwd
ls
echo "I am learning Bash"Then deliberately make a typo — try lss or eccho — and read the error message. Notice it always tells you exactly what it couldn't find.
Where to go next
You've opened a terminal, run your first commands, and read your first error. Next: navigation — how to move around the filesystem with cd, understand absolute vs relative paths, and use ls flags to see more detail.