Command Reference
Searchable Git, Docker, Linux, Maven, and PostgreSQL commands with copy buttons.
Git
git status
Show changed, staged, and untracked files.
git status
git statusgit add
Stage changes for the next commit.
git add <path>
git add src/main/java/AutoPayController.javagit commit
Record staged changes as a new commit.
git commit -m "<message>"
git commit -m "fix: null pointer on empty cart"git checkout -b
Create and switch to a new branch.
git checkout -b <branch>
git checkout -b feature/jwt-refresh-tokengit log
View commit history.
git log --oneline -n <count>
git log --oneline -n 10git stash
Temporarily shelve uncommitted changes.
git stash
git stash && git checkout maingit rebase
Replay commits from one branch onto another for a linear history.
git rebase <branch>
git rebase mainDocker
docker build
Build an image from a Dockerfile.
docker build -t <name>:<tag> <context>
docker build -t myapp:1.0 .docker run
Start a new container from an image.
docker run -p <host>:<container> <image>
docker run -p 8080:8080 myapp:1.0docker ps
List running containers.
docker ps
docker ps -adocker logs
View a container's logs.
docker logs -f <container>
docker logs -f myappdocker exec
Run a command inside a running container.
docker exec -it <container> <command>
docker exec -it myapp shdocker image prune
Remove unused images to free disk space.
docker image prune -a
docker image prune -aDocker Compose
docker compose up
Create and start all services defined in compose.yml.
docker compose up -d
docker compose up -d --builddocker compose down
Stop and remove containers and networks.
docker compose down
docker compose down -vdocker compose logs
View output from all services.
docker compose logs -f
docker compose logs -f apidocker compose exec
Run a command inside a running service.
docker compose exec <service> <command>
docker compose exec db psql -U postgresdocker compose ps
List the status of services in the stack.
docker compose ps
docker compose psLinux
systemctl status
Check whether a service is running.
systemctl status <service>
systemctl status nginxjournalctl
View systemd service logs.
journalctl -u <service> -f
journalctl -u myapp -fdf -h
Show disk usage in human-readable form.
df -h
df -htop / htop
View running processes and resource usage.
top
htopchmod
Change file permissions.
chmod <mode> <file>
chmod +x deploy.shgrep
Search text by pattern.
grep -r "<pattern>" <path>
grep -r "TODO" src/Maven
mvn clean install
Clean, compile, run tests, and install the artifact locally.
mvn clean install
mvn clean install -DskipTestsmvn test
Run the test suite.
mvn test
mvn testmvn spring-boot:run
Run the app directly without packaging a JAR first.
mvn spring-boot:run
mvn spring-boot:run -Dspring-boot.run.profiles=devmvn package
Compile and package into a JAR/WAR without installing.
mvn package
mvn package -DskipTestsmvn dependency:tree
Print the full dependency tree, useful for finding version conflicts.
mvn dependency:tree
mvn dependency:treePostgreSQL
psql
Open an interactive PostgreSQL shell.
psql -U <user> -d <database>
psql -U postgres -d appdbpg_dump
Back up a database to a SQL file.
pg_dump -U <user> <database> > backup.sql
pg_dump -U postgres appdb > backup.sqlpg_restore / psql <
Restore a database from a backup file.
psql -U <user> -d <database> < backup.sql
psql -U postgres -d appdb < backup.sql\dt
List tables (inside psql).
\dt
\dt\d <table>
Describe a table's columns and indexes (inside psql).
\d <table>
\d usersnpm
npm install
Install dependencies from package.json.
npm install
npm installnpm run build
Run the build script (production build for Next.js).
npm run build
npm run buildnpm run dev
Run the local dev server.
npm run dev
npm run devnpx
Run a package binary without installing it globally.
npx <package> <args>
npx vercel --prod