Dev Basics Lesson 1 of 3

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 directory
  • touch file.txt — Create an empty file
  • rm file.txt — Delete a file (bypasses trash; irreversible)
  • rm -r folder — Delete a directory recursively
  • cp file.txt copy.txt — Copy a file
  • mv 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.js or ../config

Efficiency note: Tab completion auto-expands file and directory names, reducing input errors and accelerating navigation.

Key Takeaways

  • pwd, ls, cd — filesystem navigation
  • mkdir, touch, rm, cp, mv — file management
  • Absolute paths reference the root; relative paths reference the working directory
  • Tab completion reduces errors and increases throughput