π₯οΈ What Is the Terminal
O terminal is a program that receives text commands and executes them on the operating system. Itβs the most direct and powerful interface to a computer β predating graphical interfaces and far more efficient for automation.
π₯οΈ Where to find the terminal
Spotlight (β+Space) β "Terminal" or install the iTerm2 for a better experience.
Comes with terminals (gnome-terminal, konsole, xterm). Shortcut: Ctrl+Alt+T on most distros.
Use WSL2 (Windows Subsystem for Linux) for a real Unix environment. PowerShell works, but there are differences.
π‘ Tip: The prompt tells you where you are
The prompt user@mac ~/projetos/meu-app $ has three parts: user@machine, current directory (~ = home), and $ indicating that you can type. Read the prompt before typing any command.
π Folders and paths
The file system is a tree: one root, with folders inside folders inside folders. Knowing where you are and how to reference files is terminal skill #1.
π³ Typical directory structure
β Absolute path
- /home/user/projetos/app
- /etc/nginx/nginx.conf
- /usr/local/bin/node
Starts with / β works from anywhere
β Relative path
- ./src/index.ts
- ../config/env.json
- ../../outro-projeto/
Relative to the current directory β shorter
β‘ Essential commands
You don't need to memorize 200 Unix commands. With 10 commands you can navigate, create, move, and inspect any project with Claude Code.
π Quick reference β 10 essential commands
How Claude Code uses these commands day to day
ls β explore the structure
The agent uses ls to understand the project before taking action. It's the first thing it does in new sessions.
mkdir -p β create structure
To create features, the agent creates the necessary folders before writing the files.
mv β refactoring
Moving files to a new folder structure during refactoring is a daily task.
π What Is a CLI
A CLI (Command-Line Interface) is a program you control by typing text commands. Git, npm, Python, Docker, and Claude Code are all CLIs. Understanding the anatomy of a CLI command is a skill that transfers to all of them.
π Anatomy of a CLI Command
β CLI best practices
- βAlways use
--helpbefore guessing - βTab completion β press Tab to autocomplete
- βUse the ββ arrows to navigate command history
- βCtrl+C cancels the current command
β CLI pitfalls
- βCopying a command from the internet without reading it
- βIgnore error messages
- βUse sudo unnecessarily
- βTyping commands in the wrong folder
π¦ Install tools
To use Claude Code, you need to install Node.js and the npm package. Understand package managers is essential β they're the standard way to install CLIs on any system.
Installing Claude Code β step by step
Install Node.js
Verify installation
Install Claude Code
π‘ What PATH is
When you type claude, the shell looks for the executable in the folders listed in the variable PATH. If you get "command not found," the global npm folder isnβt in your PATH. Solution: export PATH="$PATH:$(npm root -g)/../.bin".
π Terminal Security
The terminal has real power about the system. A wrong command can delete unrecoverable files, expose credentials, or install malicious software. These simple rules prevent 99% of problems.
β οΈ Commands you should NEVER copy without understanding
Rule: if you canβt explain what a command does, donβt run it.
β Security best practices
- βUse
.envfor secrets, and never commit this file - βCheck what you're about to delete first with
ls - βPrefer
mvto the Trash instead ofrm - βRead confirmation messages (y/n) carefully
β Common security errors
- βCommit API keys or passwords to git
- βUse sudo indiscriminately
- βRun third-party scripts without reviewing them
- βLeaving environment variables in the history
π‘ Security with Claude Code
Claude Code can run any Bash command. Configure the settings.json with a denylist for destructive commands you never want it to run automatically. That way, you have autonomy with safeguards.
"deny": ["Bash(rm -rf:*)", "Bash(git push --force:*)"]
β Module 1.4 Summary
π Track 1 complete!
You have the complete foundation: what Claude Code is, how it thinks, how it manages context, and how to use the terminal. Next step: install Claude Code for real in Track 2 β Installation.