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.
A 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.
Go to the folder where your project will live (or make a new one).
Home
Gallery
Desktop
Documents
Downloads
Music
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
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.
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
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
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.
Go to the folder where your project will live.
Recent
Home
Desktop
Documents
Downloads
Choose Open in Terminal (the label differs a little between desktops).
Recent
Home
Desktop
Documents
Downloads
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.
Three 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.