Developer Command Cheat Sheet (Garuda Linux + Full Stack Tools)
Practical command reference for daily development with: Git, pnpm/Corepack, Docker, PostgreSQL, tmux, pm2, pacman/yay, logs, and system control.
1) Git (Version Control Core)
Initial setup
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global pull.rebase true
git config --global init.defaultBranch main
Individual command meaning:
git config --global user.name "Your Name": sets your commit author name globally.git config --global user.email "you@example.com": sets your commit author email globally.git config --global pull.rebase true: makesgit pulluse rebase instead of merge by default.git config --global init.defaultBranch main: new repos start onmainbranch.
Daily status and sync
git status
git fetch --all --prune
git pull --rebase
Individual command meaning:
git status: shows working tree state (modified, staged, untracked files, branch info).git fetch --all --prune: downloads remote refs from all remotes and deletes stale remote-tracking branches.git pull --rebase: fetches then reapplies your local commits on top of upstream branch.
Branch workflow
git checkout -b feature/name
git switch main
git branch
git branch -d feature/name
Individual command meaning:
git checkout -b feature/name: creates and immediately switches to a new branch.git switch main: switches current HEAD tomain.git branch: lists local branches.git branch -d feature/name: deletes local branch only if it is already merged.
Commits and history
git add -p
git commit -m "feat(scope): add behavior"
git log --oneline --decorate --graph -20
git diff
git diff --staged
Individual command meaning:
git add -p: interactively stage selected chunks of changes.git commit -m "feat(scope): add behavior": records staged changes as a new commit.git log --oneline --decorate --graph -20: shows recent commit graph with branch/tag labels.git diff: shows unstaged changes (working tree vs index).git diff --staged: shows staged changes (index vs HEAD).
Rebase, push, and conflict help
git fetch origin
git rebase origin/main
git rebase --continue
git rebase --abort
git push -u origin feature/name
Individual command meaning:
git fetch origin: updates remote refs fromoriginonly.git rebase origin/main: replays your current branch commits on top of latestorigin/main.git rebase --continue: resumes rebase after conflict resolution.git rebase --abort: cancels rebase and returns to pre-rebase state.git push -u origin feature/name: pushes branch and sets upstream tracking for future push/pull.
Safety notes (Git):
- Always run
git statusbefore commit, rebase, and push. - During conflicts: resolve files, run
git add <file>, thengit rebase --continue. - Use
git branch -d(safe delete) over force delete unless absolutely necessary.
2) pnpm + Corepack (Node.js Package Management)
Package manager consistency
corepack enable
corepack prepare pnpm@10.33.0 --activate
pnpm --version
- Ensures your project uses controlled package-manager versions.
Install and run
pnpm install
pnpm dev
pnpm start
pnpm test
pnpm lint
pnpm build
install: syncs dependencies from lockfile.dev: development server or watcher.start: production-like start command.test,lint,build: quality and release checks.
Dependency management
pnpm add package-name
pnpm add -D package-name
pnpm remove package-name
pnpm update
pnpm outdated
- Runtime deps via
add, dev-only deps viaadd -D. outdatedshows upgrade candidates.
Workspace maintenance and clean reinstall
pnpm store prune
rm -rf node_modules
pnpm install --frozen-lockfile
store prune: clears unreferenced package data.--frozen-lockfile: fails if lockfile and manifest are out of sync.
Prisma (if project uses it)
pnpm prisma migrate dev --name init
pnpm prisma generate
pnpm prisma studio
migrate dev: creates/applies migration in development.generate: refreshes client after schema changes.studio: local data browser for quick inspection.
3) Docker + Compose (Infrastructure Layer)
Core container commands
docker ps
docker ps -a
docker images
docker logs -f <container>
docker exec -it <container> sh
docker stop <container>
docker rm <container>
Individual command meaning:
docker ps: lists currently running containers.docker ps -a: lists all containers, including stopped ones.docker images: lists local images.docker logs -f <container>: streams live logs for a container.docker exec -it <container> sh: opens interactive shell in a running container.docker stop <container>: sends stop signal and gracefully halts container.docker rm <container>: removes a stopped container.
Compose lifecycle
docker compose up -d
docker compose ps
docker compose logs -f
docker compose down
Individual command meaning:
docker compose up -d: creates/starts services in detached mode.docker compose ps: shows state of compose-managed services.docker compose logs -f: follows aggregated logs for compose services.docker compose down: stops and removes containers and default networks created by compose.
Rebuild and reset patterns
docker compose up -d --build
docker compose down --volumes --remove-orphans
docker system df
docker system prune
Individual command meaning:
docker compose up -d --build: rebuilds images, then starts stack.docker compose down --volumes --remove-orphans: removes stack, named/anonymous volumes, and orphan containers.docker system df: shows Docker disk usage (images, containers, volumes, build cache).docker system prune: removes unused Docker data (stopped containers, dangling images, unused networks/cache).
Safety notes (Docker):
docker compose down --volumesdeletes persisted service data (for example DB volumes).docker system prunecan remove build cache and unused resources needed later; review prompt before confirming.- Use
docker logs -f <container>anddocker compose logs -fbefore restarting to preserve debugging context.
4) PostgreSQL (Local or Containerized)
Service and connectivity
sudo systemctl status postgresql
sudo systemctl start postgresql
sudo systemctl enable postgresql
psql -U postgres
psql -h localhost -U <user> <db>
- Controls local service and opens CLI sessions.
Inside psql (meta commands)
\l
\c <db>
\dt
\d <table>
\dn
\q
- List DBs, connect DB, list tables, describe table, list schemas, quit.
SQL checks you use often
SELECT now();
SELECT * FROM <table> LIMIT 20;
EXPLAIN ANALYZE SELECT * FROM <table> WHERE id = 1;
- Time check, sample reads, and query plan/performance diagnostics.
PostgreSQL in Docker
docker exec -it <postgres-container> psql -U postgres
docker logs -f <postgres-container>
- Enter DB shell inside container and watch DB logs.
5) Beekeeper Studio (GUI Database Inspection)
No CLI workflow required.
Use it for:
- browsing schema and tables
- running manual exploratory queries
- validating migration outcomes visually
Do not use it as your migration or production change source-of-truth.
6) tmux (Terminal Control Room)
Sessions
tmux
tmux new -s dev
tmux ls
tmux attach -t dev
tmux kill-session -t dev
- Creates persistent terminal workspaces and reconnects after disconnects.
Panes and windows (prefix is Ctrl+b)
Ctrl+b % split vertical
Ctrl+b " split horizontal
Ctrl+b arrow move between panes
Ctrl+b c new window
Ctrl+b n next window
Ctrl+b p previous window
Ctrl+b d detach
- Run app, DB, logs, and Git in parallel without losing state.
7) pm2 (Process Manager for Long-Running Node Apps/Bots)
Start and inspect
pm2 start index.js --name app
pm2 start ecosystem.config.js
pm2 list
pm2 logs app
pm2 monit
- Starts managed processes, lists process health, streams logs, and opens monitor view.
Control lifecycle
pm2 restart app
pm2 stop app
pm2 delete app
pm2 restart all
- Restart single/all services after deploys or config changes.
Persist across reboot
pm2 save
pm2 startup
- Saves process list and prints system startup integration command.
8) pacman + yay (System Package Management)
pacman essentials
sudo pacman -Syu
sudo pacman -S <package>
pacman -Ss <keyword>
pacman -Qi <package>
sudo pacman -Rns <package>
- Full system update, install, search, inspect package info, remove with unused deps.
yay essentials (AUR)
yay -Syu
yay -S <package>
yay -Ss <keyword>
yay -Qi <package>
yay -Rns <package>
- Same flow as pacman, extended to AUR packages.
Mirror and package log checks
ls /etc/pacman.d/mirrorlist*
grep "installed\|upgraded\|removed" /var/log/pacman.log | tail -n 100
- Detect mirrorlist updates and review recent package actions.
9) System Logs and Service Debugging
journalctl and systemctl
journalctl -xe
journalctl -u docker -n 200 --no-pager
journalctl -u postgresql -f
systemctl status docker
systemctl status postgresql
journalctl -xe: recent high-detail logs.-u <service>: service-specific logs.-f: follow logs in real time.
Network and process quick checks
ss -tulpn
ps aux | grep -E "node|pm2|postgres|docker"
- View listening ports and relevant running processes.
10) File, Search, and Archive Utilities
Search and inspection
find . -name "*.sh"
find . -type f | wc -l
du -h --max-depth=1
df -h
lsblk -f
- Locate files, count files, inspect disk usage, and check filesystem/device layout.
Download and archive tools
curl -I https://example.com
wget https://example.com/file.tar.gz
tar -xvf file.tar
unzip archive.zip
- Endpoint headers, file downloads, tar extraction, and zip extraction.
11) Go Toolchain Basics (When Working in Go Projects)
go version
go mod tidy
go test ./...
go run .
go build ./...
- Verify toolchain, sync modules, test all packages, run app, and compile.
12) Daily Control Sequence (Fast Routine)
tmux new -s dev
docker compose up -d
git fetch --all --prune
git pull --rebase
pnpm install
pnpm dev
Then in parallel panes:
- DB checks via
psqlor Beekeeper - tests via
pnpm test - logs via
docker compose logs -forpm2 logs
Final Rule of Thumb
- Git = source of truth
- pnpm/Corepack = app dependency control
- Docker = infrastructure control
- tmux = execution workspace
- pm2 = production-like process control
Everything else supports these five anchors.