Linux CLI Best Practices
Eighteen practices for a fast, ergonomic terminal workflow around Rust development and operations.
Busca en todas las páginas de la documentación
Eighteen practices for a fast, ergonomic terminal workflow around Rust development and operations.
Use rg for search: Respects .gitignore; excludes target/ by default.
Use fd for paths: Faster than find for src/**/*.rs discovery.
Install tools via rustup + documented brew/apt list: Avoid ancient distro rustc.
Pin rust-toolchain.toml in repo: Matches CI and eliminates "works on my machine" version drift.
cargo build --release --locked for prod artifacts: Debug binaries mislead benchmarks.
cargo bloat before binary diet: Data-driven dependency removal.
cargo watch for TDD loop: Pair with nextest for speed.
Global gitignore target/ and .env: Prevent accidental commits.
Structured JSON logs locally when debugging prod issues: Match production tracing format.
SIGTERM integration tests: Verify graceful shutdown before k8s deploy.
perf or samply for CPU mysteries: Do not optimize from intuition alone.
Monitor open fd count under load: Catches connection pool leaks early.
journalctl for systemd services: Centralized Rust service stdout/stderr.
Compose pipelines in scripts/: Ad-hoc one-liners become team assets.
jq for JSON log queries: Works with tracing JSON subscriber output.
ulimit -n before load tests: Matches production fd limits.
Separate build and inspect concerns: Build in CI; inspect symbols in staging with debug info retained.
Document required CLI tools in onboarding checklist: New hires install once, correctly.
Prefer portable tools (rg, fd); note GNU/BSD sed differences in scripts.
WSL2 for Linux-aligned workflow; native MSVC for Windows-target builds.
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Revisado por Chris St. John·Última actualización: 16 jul 2026