Linux Command Reference

Shell & Ops

Use this page for common Linux tasks that come up during development, deployment, and troubleshooting. Each entry favors the task wording people actually search for.

Files
ls -la

Example: Use this inside a directory when you need permissions, ownership, and hidden files in one view.

Gotcha: Directory listings can be aliased in your shell. If output looks unusual, check your aliases.

Disk
du -sh *

Example: Useful when you need to spot the largest folders in the current location quickly.

Gotcha: This excludes hidden entries. Use `du -sh .[!.]* *` if you also need hidden items and your shell supports that safely.

Processes
ps aux | grep nginx

Example: Useful when you need to confirm whether a service or script is running.

Gotcha: This will also show the `grep` process itself. Use a more precise pattern or `pgrep` when available.

Stop a process by PID

kill 12345

Example: Use the default signal first before moving to a forceful kill.

Gotcha: Prefer `kill` before `kill -9`. A forceful signal can skip cleanup logic and leave partial state behind.

Archives
tar -czf backup.tar.gz app/ storage/

Example: A practical way to package project files for backup or transfer.

Gotcha: Be explicit about included paths so you do not accidentally archive unnecessary directories like `node_modules`.

CodersTool Categories