๐Ÿ–ฅ๏ธ

Terminal & Shell

๐Ÿง‘โ€๐ŸŽ“ Apprentice

Before cooking, you need to know your kitchen

Imagine you're a chef. Before preparing a dish, you need to know your kitchen: where the utensils are, how each one works, and why you use a chef's knife instead of a spoon to chop vegetables.

Software development is the same. Your computer is the kitchen. The Terminal is your main workstation. And the tools we'll install are your precision utensils.

The difference between a novice cook and an experienced chef isn't just the dishes they prepare, but how well they know their kitchen and tools.


The Terminal: Your command center

The Terminal is a window that lets you talk directly to your computer using text. Instead of clicks and windows, you use written commands.

How to open the terminal?

SystemHow to openName
macOSCmd + Space โ†’ "Terminal"Terminal.app or iTerm2
LinuxCtrl + Alt + TGNOME Terminal, Konsole
WindowsWin + X โ†’ TerminalWindows Terminal, PowerShell

๐Ÿ’ก Windows: We recommend installing Windows Terminal from the Microsoft Store. It's modern and supports tabs.

Your first command

Open Terminal and type:

echo "Hello, I am a developer"

You just gave your computer an instruction. echo means "repeat what I tell you".

Essential commands

# Where am I?
pwd

# What's here?
ls

# Go to another folder
cd Documents

# Go back
cd ..

# Go home
cd ~

๐Ÿ’ก Tip: Press Tab to autocomplete file names.


The Shell: The interpreter

When you type in Terminal, there's a program that interprets what you write. That program is called the Shell.

SystemDefault shellAlternative
macOSzshbash, fish
Linuxbashzsh, fish
WindowsPowerShellGit Bash, WSL

Your configuration file

SystemShellFile
macOSzsh~/.zshrc
Linuxbash~/.bashrc
WindowsPowerShell$PROFILE

PATH: The tools map

When you type git, how does your computer know where it is?

PATH is a list of folders where the system looks for programs.

# View your PATH
echo $PATH

โš ๏ธ If you install something and it says "command not found", you probably need to add its folder to PATH.


Useful links