Python · Stage 0 · Before You Code · Lesson 4 of 50

Terminal and Basic Navigation

Learn what a terminal is, how to open it, and how to move between folders.

Windows: open Start, type PowerShell, and select Windows PowerShell. macOS: press Command + Space, type Terminal, and press Return. Linux: search the application menu for Terminal; many desktops also use Ctrl + Alt + T.

Ask the terminal which folder you are currently inside:

pwd
Line-by-line explanation
  1. pwd means “print working directory”.
  2. A directory is another word for a folder.
  3. The output is the full location of your current folder.

Windows PowerShell also understands pwd. Now list the current folder:

ls
Line-by-line explanation
  1. ls means “list”.
  2. The output shows files and folders inside your current location.

Move into the Documents folder:

cd Documents
Line-by-line explanation
  1. cd means “change directory”.
  2. Documents is the folder to enter.
  3. A successful move normally produces no output.

Move back to the folder that contains it:

cd ..
Line-by-line explanation
  1. cd means change directory.
  2. .. is a special name meaning “the parent folder”.