Terminal Basics
Overview
The terminal (command line interface) provides direct interaction with the operating system. Claude Code operates as a terminal application, making command-line proficiency a prerequisite for effective use.
Terminal Environment
The appropriate terminal application depends on the operating system:
Platform reference: macOS/Linux — Terminal.app or equivalent. Windows — PowerShell or WSL (Windows Subsystem for Linux).
Navigation Commands
Print working directory
pwd
Outputs the absolute path of the current directory.
List directory contents
ls
Enumerates files and directories. The -la flag displays detailed metadata including hidden files.
Change directory
cd folder-name
Navigates to the specified directory. cd .. moves to the parent; cd ~ returns to the home directory.
File Operations
mkdir project— Create a directorytouch file.txt— Create an empty filerm file.txt— Delete a file (bypasses trash; irreversible)rm -r folder— Delete a directory recursivelycp file.txt copy.txt— Copy a filemv old.txt new.txt— Move or rename a file
Path Conventions
A path specifies the location of a file or directory within the filesystem hierarchy.
- Absolute path: Full path from the filesystem root —
/Users/you/projects/app - Relative path: Path relative to the current working directory —
./src/index.jsor../config
Efficiency note: Tab completion auto-expands file and directory names, reducing input errors and accelerating navigation.
Key Takeaways
pwd,ls,cd— filesystem navigationmkdir,touch,rm,cp,mv— file management- Absolute paths reference the root; relative paths reference the working directory
- Tab completion reduces errors and increases throughput