Terminal Basics for Beginners
The 10 commands you'll use every day
beginner1 min read
terminalcommand-linebasicsswe
The terminal (also called the command line or shell) is how developers interact with their computer beyond clicking and dragging. It might look intimidating at first, but you really only need about 10 commands to be productive.
iWhere's my terminal?
Mac: Open Terminal from Applications → Utilities, or use Spotlight (Cmd+Space, type 'Terminal').
Windows: Use Windows Terminal or PowerShell from the Start menu.
VS Code: Terminal → New Terminal (or Ctrl+`).
Windows: Use Windows Terminal or PowerShell from the Start menu.
VS Code: Terminal → New Terminal (or Ctrl+`).
Navigation commands
- 1pwd — Print Working Directory. Shows where you currently are in the file system
- 2ls — List. Shows all files and folders in your current directory
- 3cd foldername — Change Directory. Move into a folder
- 4cd .. — Move up one level (back to the parent folder)
- 5cd ~ — Go to your home directory from anywhere
macOS
$pwd
macOS
$ls -la
macOS
$cd Documents
File management commands
- 1mkdir foldername — Make Directory. Creates a new folder
- 2touch filename — Creates a new empty file
- 3cp source destination — Copy a file
- 4mv source destination — Move or rename a file
- 5rm filename — Remove (delete) a file. Be careful — there's no undo!
!Be careful with rm
The
rm command permanently deletes files — they don't go to the Trash. Double-check what you're deleting before pressing Enter.macOS
$mkdir my-project && cd my-project
Understanding file paths
A path is like an address for a file. There are two kinds:
- Absolute path: Starts from the root —
/Users/you/Documents/project - Relative path: Starts from where you are —
./src/index.js