Your First Commands
Let’s learn your first five commands. Each one does exactly one thing — that’s the Unix philosophy.
pwd — Print Working Directory
What it does: Shows where you are in the filesystem.
Try it now: Type pwd and press Enter.
You should see /home/user. That’s your home directory — the starting point for everything you do.
When AI tools use it: AI assistants often run pwd to figure out where they are before doing anything else.
whoami — Who Am I?
What it does: Prints your username.
Try it now: Type whoami
You’ll see user. Simple. On a real system, this tells you which account you’re using — important for knowing what permissions you have.
echo — Print Text
What it does: Prints whatever text you give it.
Try it now: Type echo "Hello, terminal!"
echo might seem basic, but it’s incredibly useful:
- Writing text to files:
echo "hello" > file.txt - Checking variable values:
echo $HOME - Building scripts that output messages
When AI tools use it: AI assistants use echo with > and >> to create and edit files — you’ll learn about this in Module 5.
clear — Clear the Screen
What it does: Clears all the text from the terminal.
Try it now: Type clear
Everything disappears! Don’t worry — nothing is deleted. Your files are untouched. It just cleans up the display.
Shortcut: Press Ctrl+L for the same effect.
history — Command History
What it does: Shows all the commands you’ve typed in this session.
Try it now: Type history
You’ll see a numbered list of everything you’ve entered. This is useful for:
- Remembering what you did
- Re-running a previous command
- Understanding what an AI tool has been doing
Pro tip: Press the Up arrow key to scroll through your previous commands. Press Down arrow to go forward. Try it!
pwd — where am I?whoami — who am I?echo — print textclear — clean the screen (Ctrl+L)history — what have I typed?