commands
Common command line commands, ready to copy and run
Navigation
pwd Print Working Directory
Show the full path of the directory you're currently in.
ls List Files
List files and folders in the current directory.
ls -la List All Files with Details
Show all files including hidden ones, with permissions, size, and dates.
ls -lt List Files by Date
List files sorted by most recently modified first.
ls -lhS List Files by Size
List files sorted by size, largest first, with human-readable sizes.
cd .. Go Up One Directory
Move to the parent directory.
cd ~ Go to Home Directory
Jump back to your home directory from anywhere.
cd - Go to Previous Directory
Switch back to the last directory you were in.
tree Show Directory Tree
Display the folder structure two levels deep.
tree clean Directory Tree (skip node_modules)
Show folder structure three levels deep, ignoring node_modules.
du -sh . Size of Current Directory
Show the total size of the current directory.
du sorted Size of Each Subdirectory
List subdirectories sorted by size, largest first.
Git
git status Git Status
Show which files are modified, staged, or untracked.
git log Compact Commit History
Show the last 20 commits in a compact one-line format.
git graph Visual Branch History
Show a visual graph of all branches and their commits.
git branch List Local Branches
Show all local branches and highlight the current one.
git branch -a List All Branches
Show all branches including remote tracking branches.
git diff Show Unstaged Changes
Display line-by-line changes that haven't been staged yet.
git diff staged Show Staged Changes
Display changes that are staged and ready to commit.
git diff stat Change Summary
Show a summary of which files changed and how many lines were added or removed.
git stash list List Stashes
Show all stashed changes you've saved for later.
git remote -v Show Remote URLs
List all configured remotes with their fetch and push URLs.
git recent Commits This Week
Show all commits made in the last 7 days.
git shortlog Contributors by Commit Count
Rank contributors by number of commits.
git fetch Fetch All Remotes
Download latest changes from all remotes without merging.
git add . Stage All Changes
Stage every modified and new file for the next commit.
git push Push to Remote
Upload local commits to the remote repository.
System
df -h Disk Space Overview
Show how much disk space is used and available on each drive.
clear Clear Terminal
Clear all output from the terminal screen.
whoami Current Username
Show which user account is currently active.
uname -a System Information
Display full system information including OS, kernel, and architecture.
uptime System Uptime
Show how long the system has been running and current load.
date Current Date and Time
Print the current date and time.
hostname Machine Name
Show the name of the current machine.
echo $SHELL Current Shell
Show which shell you're using (bash, zsh, etc.).
echo $PATH Show PATH
Display the directories the system searches for executables.
cal Calendar
Show the current month's calendar.
history Command History
List previously run commands in this shell session.
alias List Aliases
Show all command aliases configured in your shell.
python3 -V Python Version
Check which version of Python 3 is installed.
pip list Installed Python Packages
List all Python packages installed in the current environment.
Processes
Network
Node & npm
node -v Node.js Version
Check which version of Node.js is installed.
npm -v npm Version
Check which version of npm is installed.
npm ls Installed Packages
List top-level npm packages installed in the current project.
npm outdated Outdated Packages
Check which npm packages have newer versions available.
npm audit Security Audit
Scan installed packages for known security vulnerabilities.
tsc check TypeScript Type Check
Run the TypeScript compiler to check for type errors without emitting files.
which node Where Is Node Installed
Show the file path of the Node.js binary being used.
Docker
docker ps Running Containers
List all Docker containers that are currently running.
docker ps -a All Containers
List all Docker containers including stopped ones.
docker images List Docker Images
Show all Docker images downloaded to this machine.
docker up Start Docker Services
Start all services defined in docker-compose.yml in the background.
docker down Stop Docker Services
Stop and remove all containers defined in docker-compose.yml.
docker logs Follow Docker Logs
Stream live logs from all Docker Compose services.