Command Safety Reference

Some command patterns are common in normal work, but still deserve extra caution before execution.

rm -rf

Why caution: recursive deletion can remove critical files quickly.

Review first: path, working directory, and whether backups exist.

Safer alternative: list targets before deleting and delete narrower paths.

curl ... | sh

Why caution: executes remote script content immediately.

Review first: source URL, script content, and publisher trust.

Safer alternative: download first, inspect, then run with clear intent.

sudo ...

Why caution: elevated privileges can change system-wide settings.

Review first: exact command effects and whether admin rights are required.

Safer alternative: run as regular user when possible and scope privileges.

chmod -R ...

Why caution: recursive permission changes can overexpose data.

Review first: target path and desired permission model.

Safer alternative: set minimal permissions on specific files only.

Package install scripts

Why caution: install hooks can run extra commands during setup.

Review first: package metadata, scripts, and maintainer reputation.

Safer alternative: use lockfiles, pin versions, and isolate test installs.

Ask for confirmation whenever commands are destructive, privileged, or unclear.