Helpful Terminal Commands
A quick reference for common commands you might encounter while working with AI coding tools, Git, Node.js, Docker, and modern development workflows.
File System Navigation & Manipulation
pwdPrint Working Directory - Shows the full path of the current folder.
lsList - Shows files and folders in the current directory.
ls -aLists *all* files, including hidden ones (like `.env`, `.git`).
ls -lLists files in long format (permissions, owner, size, date).
cd <directory_name>Change Directory - Moves into the specified folder.
cd ..Moves one level up (to the parent folder).
cd ~Moves to your home directory.
mkdir <directory_name>Make Directory - Creates a new empty folder.
touch <file_name>Creates a new empty file or updates modification time.
cat <file_name>Concatenate - Displays the entire content of a file.
tree -I 'node_modules|dist|.git|build' -aShows directory structure as a tree, ignoring common folders and showing hidden files. (*Note: `tree` might need to be installed*).
Git Version Control
git statusShows the current state of your repository (changes, branch). Run this often!
git branchLists local branches and highlights the current one.
git checkout <branch_name>Switches your working directory to the specified branch.
git checkout -b <new_branch_name>Creates a *new* branch and switches to it.
git add <file_name>Adds specific file changes to the staging area (prepares for commit).
git add .Adds *all* modified/new files in the current directory to staging.
git commit -m "Your message"Records staged changes to project history with a descriptive message.
git push origin <branch_name>Uploads committed local changes to the remote repository (e.g., GitHub).
git pull origin <branch_name>Downloads remote changes for the branch and merges them locally.
Node.js / Project Management (NPM)
npm installInstalls all project dependencies listed in `package.json`.
npm run devRuns the "dev" script from `package.json` (usually starts the development server).
npm run buildRuns the "build" script from `package.json` (usually creates a production version).
npm run dev -- --host(Vite specific) Runs dev server accessible on your local network (uses your IP).
Networking / Utilities
curl <URL>Client URL - Transfers data from/to a server. Useful for testing APIs or downloading.
Example: curl https://api.github.com/users/octocat
grep "pattern" <file>Global Regular Expression Print - Searches for lines containing text pattern within a file.
Example: grep "error" server.log
PostgreSQL (psql) via Docker
docker exec -it local-postgres psql -U postgresConnect to the PostgreSQL server running in your Docker container (named 'local-postgres') as the 'postgres' user. You will be prompted for the password you set when running the container.
\lList all databases in the PostgreSQL server. (Run inside psql)
\c <database_name>Connect to a specific database. (Run inside psql)
Example: \c myapp_db
\dtList all tables in the currently connected database. (Run inside psql)
\d <table_name>Describe a table (show its columns and types). (Run inside psql)
Example: \d users
SELECT * FROM <table_name>;Retrieve all rows and columns from a table. Remember the semicolon! (Run inside psql)
Example: SELECT * FROM products;
CREATE DATABASE <new_db_name>;Create a new database. (Run inside psql)
Example: CREATE DATABASE my_new_application_db;
\qQuit psql and return to your regular terminal. (Run inside psql)
Prisma ORM / Database GUI
npx prisma studioOpens Prisma Studio in your web browser, a GUI tool to view and manage data in your database. Useful for inspecting data during development.
Example: Run this command in the root directory of your project where your Prisma schema is located.
Requirements for `npx prisma studio`To use `npx prisma studio`, ensure the following are set up in your project:
• **Node.js & npm/npx:** Must be installed on your system.
• **Prisma CLI:** Your project needs the Prisma CLI. If not already installed, add it as a dev dependency: `npm install prisma --save-dev`
• **Prisma Schema (`schema.prisma`):** This file must exist (usually in a `prisma` directory) and be correctly configured with your database connection URL.
• **Database Server Running:** The database (e.g., PostgreSQL, MySQL, SQLite) defined in your schema must be running and accessible.
• **Prisma Client Generated:** After any changes to your `schema.prisma`, run `npx prisma generate` to update the Prisma Client.Claude Code CLI
claudeStart an interactive Claude Code session in your terminal.
claude "your prompt here"Send a one-off prompt to Claude Code without entering interactive mode.
/helpShow available commands and usage information inside a Claude Code session.
/clearClear the conversation history and start fresh.
/commitLet Claude Code generate a commit message and create a git commit for your staged changes.
/review-prHave Claude Code review a pull request and provide feedback.
claude --model sonnetStart Claude Code with a specific model (sonnet, opus, haiku).
cat file.txt | claude "summarise this"Pipe content into Claude Code for analysis or transformation.
Cursor-Specific
Cmd+L / Ctrl+LOpen the Cursor Chat panel to ask questions about your code.
Cmd+I / Ctrl+IOpen Cursor Composer for multi-file edits and code generation.
Cmd+K / Ctrl+KInline code editing — select code and describe changes you want.
.cursorrulesA configuration file in your project root that defines coding rules and preferences for Cursor's AI to follow.
.cursorignoreA file (like .gitignore) that tells Cursor which files/folders the AI should ignore.
Docker Compose
docker compose upStart all services defined in your docker-compose.yml file.
docker compose up -dStart services in detached (background) mode.
docker compose downStop and remove all containers, networks, and volumes defined in docker-compose.yml.
docker compose psList all running containers managed by Docker Compose.
docker compose logs -fFollow (stream) logs from all Compose services in real-time.
docker compose buildBuild or rebuild Docker images for services defined in docker-compose.yml.
Vercel CLI
npm install -g vercelInstall the Vercel CLI globally.
vercelDeploy the current project to a preview URL on Vercel.
vercel --prodDeploy directly to production.
vercel devRun the Vercel development server locally (simulates serverless functions).
vercel env pullDownload environment variables from your Vercel project to a local .env file.
vercel logs <deployment-url>View runtime logs for a specific deployment.
Supabase CLI
npm install -g supabaseInstall the Supabase CLI globally.
supabase initInitialise a new Supabase project in the current directory.
supabase startStart a local Supabase stack (Postgres, Auth, Storage, etc.) using Docker.
supabase stopStop the local Supabase stack.
supabase db pushPush local database migrations to a linked remote Supabase project.
supabase functions serveServe Supabase Edge Functions locally for development and testing.
supabase db resetReset the local database to a clean state by re-running all migrations.