Crash Course on the Terminal
The terminal (or "Command Line") is a text-based way to talk to your computer. Instead of clicking icons, you type commands to tell the computer what to do.
You will use the terminal to install Habitat-Mapper and run the image processing tools.
1. Opening the Terminal
Choose your operating system to see how to start.
We recommend using PowerShell (not the old "Command Prompt").
- Press the Windows Key.
- Type
PowerShell. - Click Windows PowerShell to open it.
(It will look like a blue or black window with text waiting for you to type).
- Press Cmd+Space to open Spotlight Search.
- Type
Terminal. - Press Enter.
You likely already know this, but usually:
- Press Ctrl+Alt+T.
- Or search
Terminalin your applications menu.
2. The "Magic" Keys
Before typing commands, learn these two keys. They will save you hours of typing and frustration.
Tab Completion (The most important key!)
Never type a full filename or folder name manually. Instead, type the first few letters and press Tab. The terminal will auto-complete the name for you.
- Why? It prevents typos. If you press Tab and nothing happens, you know you made a mistake or the file isn't there.
The Up Arrow
Press the Up key to see the last command you ran. Press it again to go back further. This is great for re-running a command without re-typing it.
3. Basic Navigation
You can think of the terminal as being "inside" a specific folder on your computer. You use commands to look around or move to a different folder.
The Cheat Sheet
| Goal | Command | Example |
|---|---|---|
| List files in current folder | ls or dir |
ls |
| Change to a folder | cd |
cd Documents |
| Go Back one folder | cd .. |
cd .. |
| Go Home (User folder) | cd ~ |
cd ~ |
| Where am I? | pwd |
pwd |
| Goal | Command | Example |
|---|---|---|
| List files in current folder | ls |
ls |
| Change to a folder | cd |
cd Documents |
| Go Back one folder | cd .. |
cd .. |
| Go Home (User folder) | cd ~ |
cd ~ |
| Where am I? | pwd |
pwd |
Understanding Paths
A "Path" is just an address for a file. You will often see special symbols used in these addresses.
The Dot Symbols (. and ..)
These are shortcuts that act like relative directions:
.(One Dot) = "Here" (The folder you are currently in).- Usage: You often see this when running scripts, like
./activate(run the activate script located right here).
- Usage: You often see this when running scripts, like
..(Two Dots) = "Parent Folder" (The folder directly above this one).- Usage: Typing
cd ..is like clicking the "Up" or "Back" button in your file explorer. It moves you out of the current folder.
- Usage: Typing
Rules of the Road
- Spaces: If a folder has a space in the name, you must use quotes.
cd My Documents(Will fail)cd "My Documents"(Works!)
- Separators:
- Windows uses backslashes
\(e.g.,C:\Users\Name). - Mac/Linux uses forward slashes
/(e.g.,/home/name).
- Windows uses backslashes
Try it yourself
Open your terminal and try these steps:
- Type
cd ~and press Enter (Goes to your home folder). - Type
cd Doand press Tab (Should auto-complete toDownloadsorDocuments). - Press Enter to go there.
- Type
ls(ordiron Windows) to see what is inside.
What success looks like:
You should see a list of files and folders in your terminal. The list might include folders like "Projects", images, or documents you've saved there.
If you see an error like No such file or directory, press the Up key to see your last command and check for typos. Remember to use Tab completion to avoid mistakes!
4. Copying and Pasting
Pasting commands into a terminal can be tricky.
- Windows (PowerShell): usually Right-Click anywhere in the window to paste. (Ctrl+V works in newer versions).
- Mac (Terminal): use Cmd+V.
- Linux: usually Ctrl+Shift+V (since Ctrl+V often has a different meaning).
Next Steps
Now that you can move around, let's get the software installed.