The terminal is just a text chat with your computer.
You type a short instruction, press Enter, and the computer answers. That is all. In this chapter you learn to open one in the right folder and to walk around with three commands.
Open a terminal in the right folder
pick your computerA terminal always sits inside one folder. Git works on the folder you are in, so opening it in the right place is the first real skill. The screens below are illustrations rebuilt in the browser, not real screenshots.
Right-click inside the folder
Open the folder in File Explorer
Go to the folder where your project will live (or make a new one).
Home
Gallery
Desktop
Documents
Downloads
Music
Right-click empty space
Click on blank space inside the folder, not on a file. On Windows 11 choose Open in Terminal. (Windows 10 has no such entry: use the shortcut below.)
Home
Gallery
Desktop
Documents
Downloads
Music
Check the prompt
Windows Terminal opens already inside that folder. The path in the prompt should end with the folder name.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\you\Documents\myproject> Shortcut: Faster, on any Windows: click the address bar in Explorer, type powershell, press Enter.
Windows heads-up: Until Git is installed (Chapter 4), use Windows Terminal or PowerShell. pwd, ls and cd work there. For hidden items PowerShell wants ls -Force where the practice below uses ls -a. In Chapter 4 you switch to Git Bash, which behaves like macOS and Linux, and every chapter after that uses it.
Right-click the folder → Services → New Terminal at Folder
Find the folder in Finder
Open Finder and go to the folder that holds your project (here: Documents, with a folder called myproject).
Favorites
AirDrop
Recents
Applications
Desktop
Documents
Downloads
Right-click the folder
Choose Services, then New Terminal at Folder. If you do not see it, turn it on in System Settings → Keyboard → Keyboard Shortcuts → Services.
Favorites
AirDrop
Recents
Applications
Desktop
Documents
Downloads
Check the prompt
Terminal opens inside that folder. The prompt ends with the folder name.
Last login: Sun Oct 4 10:42:13 on ttys000
you@MacBook-Air myproject % Shortcut: Or: press Cmd + Space, type Terminal, press Enter. Then type cd and a space, drag the folder from Finder into the window, press Enter.
Right-click → Open in Terminal
Open your file manager
Go to the folder where your project will live.
Recent
Home
Desktop
Documents
Downloads
Right-click empty space
Choose Open in Terminal (the label differs a little between desktops).
Recent
Home
Desktop
Documents
Downloads
Check the prompt
The prompt shows you are inside the folder.
you@linux:~/Documents/myproject$
Shortcut: Or press Ctrl + Alt + T, then use cd to walk to the folder.
Read a prompt
tap the piecesPractice: walk around
hands-onThree commands do most of the work: pwd (where am I?), ls (what is here?), cd (go there). Find the hidden folder called treasure. This practice terminal is bash-style: it behaves like Git Bash, macOS Terminal and Linux.