// REFERENCES

Developer
CHEAT SHEETS.

Quick reference for CLI commands and development tools, from Git and Docker to SQL and HTTP status codes. Everything in one place and copyable in one click.

103 commands

Git

› Setup & Init

git init

Initialize a new Git repository.

git clone [url]

Clone an existing repository.

git config --global user.name "[name]"

Set the author name.

git config --global user.email "[email]"

Set the author email.

› Stage & Snapshot

git status

Show modified files in working directory.

git add [file]

Add a file to the staging area.

git add .

Add all current changes to the staging area.

git commit -m "[message]"

Commit staged files with a message.

git commit --amend

Modify the last commit.

› Branch & Merge

git branch

List all local branches.

git branch [name]

Create a new branch.

git checkout [branch]

Switch to a specific branch.

git checkout -b [branch]

Create and switch to a new branch.

git merge [branch]

Merge a branch into the active branch.

git branch -d [branch]

Delete a local branch.

› Stash

git stash

Temporarily store modified, tracked files.

git stash pop

Restore the most recently stashed files.

git stash list

List all stashed changes.

git stash drop

Discard the most recently stashed files.

Docker

› Images

docker pull [image]

Download an image from a registry.

docker images

List all local images.

docker rmi [image]

Remove a local image.

docker build -t [name] .

Build an image from a Dockerfile in the current directory.

› Containers

docker ps

List all running containers.

docker ps -a

List all containers (running and stopped).

docker run [image]

Create and start a container from an image.

docker run -d -p 8080:80 [image]

Run container in background and map port.

docker stop [container]

Gracefully stop a running container.

docker rm [container]

Remove a stopped container.

docker exec -it [container] sh

Access the shell of a running container.

› Docker Compose

docker compose up

Create and start containers.

docker compose up -d

Start containers in detached mode.

docker compose down

Stop and remove containers, networks.

docker compose logs -f

View output from containers continuously.

Linux CLI

› File Operations

ls -la

List all files in long format (including hidden).

cd [dir]

Change directory.

pwd

Print working directory.

mkdir [dir]

Create a new directory.

rm -rf [dir]

Force remove a directory and its contents recursively.

cp -r [src] [dest]

Copy files and directories recursively.

mv [src] [dest]

Move or rename files or directories.

› Permissions

chmod 755 [file]

Set rwx for owner, rx for group/others.

chown [user]:[group] [file]

Change file owner and group.

› Process & Network

top

Display Linux processes.

htop

Interactive process viewer (if installed).

kill -9 [pid]

Force kill a process by ID.

netstat -tulpn

List all listening ports and their PIDs.

curl -I [url]

Fetch HTTP headers of a URL.

Kubernetes

› Basic Commands (kubectl)

kubectl get nodes

List all nodes in the cluster.

kubectl get pods

List all pods in the current namespace.

kubectl get pods -A

List all pods in all namespaces.

kubectl describe pod [name]

Show detailed information about a pod.

kubectl delete pod [name]

Delete a pod.

› Deployments & Services

kubectl get deployments

List deployments.

kubectl get svc

List services.

kubectl apply -f [file.yaml]

Apply a configuration file.

kubectl port-forward svc/[name] 8080:80

Forward local port to a service.

kubectl logs -f [pod_name]

Stream logs from a pod.

SQL

› Data Querying (DQL)

SELECT * FROM table;

Select all columns from a table.

SELECT col1, col2 FROM table WHERE condition;

Select specific columns with a condition.

SELECT * FROM table ORDER BY col DESC LIMIT 10;

Sort results descending and limit to 10.

› Data Manipulation (DML)

INSERT INTO table (col) VALUES (val);

Insert a new row.

UPDATE table SET col = val WHERE condition;

Update existing rows.

DELETE FROM table WHERE condition;

Delete rows matching a condition.

› Joins & Grouping

SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;

Inner join two tables.

SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id;

Left join two tables.

SELECT col, COUNT(*) FROM table GROUP BY col;

Group rows and count occurrences.

NPM & Yarn

› NPM Commands

npm init -y

Initialize a new project with defaults.

npm install [pkg]

Install a package and add to dependencies.

npm install -D [pkg]

Install a package as a devDependency.

npm run [script]

Run a script defined in package.json.

npm update

Update all packages to the latest allowed versions.

› Yarn Equivalents

yarn init -y

Initialize a new project.

yarn add [pkg]

Install a package.

yarn add -D [pkg]

Install a devDependency.

yarn [script]

Run a script.

yarn upgrade

Update all packages.

Flutter

› Project Setup

flutter create [name]

Create a new Flutter project.

flutter doctor

Check your Flutter environment status.

flutter clean

Delete the build/ directory.

› Run & Build

flutter run

Run the app on an attached device.

flutter build apk

Build an Android APK.

flutter build ios

Build an iOS app bundle.

› Packages

flutter pub get

Get dependencies listed in pubspec.yaml.

flutter pub add [pkg]

Add a new dependency to pubspec.yaml.

flutter pub upgrade

Upgrade dependencies to latest compatible versions.

Dart

› Basic CLI

dart run [file.dart]

Execute a Dart script.

dart format .

Format all Dart files in the current directory.

dart analyze

Analyze the project's Dart code for errors/warnings.

dart fix --apply

Automatically fix formatting and simple errors.

› Testing & Compilation

dart test

Run unit tests.

dart compile exe [file.dart]

Compile a Dart script into a standalone executable.

HTTP Status

› 2xx Success

200 OK

Standard response for successful HTTP requests.

201 Created

Request fulfilled and new resource created.

204 No Content

Request successful, but no content to return.

› 4xx Client Errors

400 Bad Request

The server cannot process the request due to client error.

401 Unauthorized

Authentication is required and has failed or not provided.

403 Forbidden

Client does not have access rights to the content.

404 Not Found

The server can not find the requested resource.

429 Too Many Requests

The user has sent too many requests in a given amount of time.

› 5xx Server Errors

500 Internal Server Error

The server encountered an unexpected condition.

502 Bad Gateway

The server acting as a gateway received an invalid response.

503 Service Unavailable

The server is not ready to handle the request.