Go · Stage 0 – Before You Code · Lesson 4 of 64

Terminal and Basic Navigation

Open a terminal and learn the minimum navigation needed to create a Go project.

Windows: open Start, type PowerShell, and select it. macOS: press Command + Space, type Terminal, and press Return. Linux: search the app menu for Terminal.

Command

pwd
Line-by-line explanation
  1. pwd means “print working directory”.
  2. It displays the current folder’s full address.
Expected output
/home/maya

Windows PowerShell may display a path such as C:\Users\Maya.

Command

ls
Line-by-line explanation
  1. ls means list.
  2. It shows names inside the current directory.
Expected output
Desktop  Documents  Downloads

PowerShell, macOS, and Linux all understand ls. Your names will differ.

Command

cd Documents
Line-by-line explanation
  1. cd means change directory.
  2. The space separates the command from its destination.
  3. Documents is the folder to enter.
Expected output
(no output)

A successful directory change is normally silent. Run pwd separately to confirm.

Tiny Practice

Starter scenario

Enter your Documents folder from a fresh home-directory prompt.

Starter template

cd CHANGE_ME
Line-by-line explanation
  1. The command is ready.
  2. Only the folder name is missing.
Expected output
(no output)

The starter is incomplete, so do not expect it to run successfully until you replace the missing part.

Hint
  1. Use the common folder name Documents.
  2. Match its capital D.
  3. Success normally prints nothing.
Show Solution

Solution command

cd Documents
Line-by-line explanation
  1. Change directory selects a new working folder.
  2. Documents is the destination.
Expected output
(no output)

Silence normally means success; use pwd afterward if unsure.