liveBook · Manning

Cd command

As explained in Build Applications with Local AI Models on a Mac

A command that changes the current working directory.

`cd` means “change directory.” A directory is a folder; your current directory is the folder the terminal is working in. Type `cd` followed by a folder path to move there. For example, `cd Desktop` moves from your home directory into its Desktop folder. section 1.7.3

A few forms cover common moves:

  • `cd ..` moves up one folder, to the parent directory. section 1.7.3
  • `cd ~` or `cd` alone returns to your home directory. `cd ~/Documents` goes directly to Documents in that home directory. section 1.7.3
  • Put a path containing spaces in quotes, as in `cd "My Folder"`. Type `cd` in lowercase, and match the folder name’s capitalization. section 1.7 section 1.7.3

After moving, run `pwd` to check your location or `ls` to see what is in the folder. If `cd Desktop` reports “no such file or directory,” use `ls` to find the exact folder name. Do not type a path by itself: the shell may try to run it as a command instead of moving there. section 1.7.3

cd ..
pwd

Run `cd ..` to move to the parent folder, then `pwd` to confirm where you landed. section 1.7.3

How Build Applications with Local AI Models on a Mac covers it

How deep it goes
Defines the command and works through paths, shortcuts, verification, and common typing errors without examining shell internals.
Examples
Uses `cd Desktop`, `cd ..`, `cd ~/Documents`, and a quoted folder name to illustrate moves.
What it assumes
Introduces terminal navigation from basic folder moves rather than assuming command-line experience.
What you can do after
Practice/perform terminal navigation by changing folders and checking the result with `pwd` or `ls`.
How it connects
Connects directory changes with the current working directory, parent directories, home directories, `pwd`, and `ls`.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Applications with Local AI Models on a Mac. The section links point to the parts of the book it draws on.