What the terminal actually is
The terminal (also called the command line, shell, or console) is a text-based way to talk directly to your computer โ instead of clicking icons, you type commands. On Mac and Linux it's usually called Terminal; on Windows it's PowerShell or Command Prompt (most developers on Windows now use Git Bash or WSL for a more standard experience, since it matches Mac/Linux commands).
The prompt: reading what it's telling you
Everything before the $ is just context (your username, computer name, and current folder). The $ is where you type. Every command in this lesson goes right after it.
Moving around: the commands you'll use constantly
| Command | Does |
|---|---|
pwd | "Print working directory" โ shows exactly where you are right now |
ls | Lists everything in the current folder |
cd foldername | "Change directory" โ moves into a folder |
cd .. | Moves up one folder (to the parent) |
cd ~ | Jumps straight back to your home folder from anywhere |
Working with files and folders
| Command | Does |
|---|---|
mkdir name | Creates a new folder |
touch file.txt | Creates a new empty file |
rm file.txt | Deletes a file โ no recycle bin, be careful |
rm -r foldername | Deletes a folder and everything inside it |
cp source.txt copy.txt | Copies a file |
mv old.txt new.txt | Renames or moves a file |
rm does not ask "are you sure?" and does not send files to a trash bin โ they're gone immediately. Double-check the file name before pressing Enter, especially with rm -r.
Opening the current folder in VS Code
This single command opens your code editor directly in whatever folder you're currently in โ no navigating through "File โ Open" menus. It's one of the most-used commands once it becomes habit.
Clearing the clutter
Wipes the visible history in your terminal window so you're not scrolling past old commands. Nothing is actually deleted โ it's purely visual.
Try it yourself
pwd to see where you are, ls to see what's there, and cd into any folder you can see. Then use mkdir to create a new folder called devnotes-practice, and cd into it.
Level up: build a small project structure
devnotes-practice folder, use touch to create index.html, style.css, and script.js. Run ls to confirm all three exist, then run code . to open the whole folder in VS Code.
1. What does cd .. do?
2. Which command permanently deletes a file with no recycle bin?
3. What does pressing Tab while typing a file name do?
pwd, ls, and cd cover 90% of daily terminal navigation. Add mkdir, touch, and code ., and you can build an entire project structure without touching a mouse.