Core UNIX Commands

The table below is 80 % of what you’ll type each day. Flags shown are the safe defaults we review in PRs.

CommandCheat‑descriptionExample
pwdprints full path of current directorypwd
envdumps environment variables (useful for debugging config)env | grep DATABASE
cdchange directory (cd ‑ jumps back)cd ~/projects
ls ‑lalist files, humans size, dotfiles visible, colorized by defaultls -la ~/Downloads
mkdir ‑pmake directory, parents if neededmkdir -p tmp/cache
cp ‑acopy file/dir, preserve perms (-r not needed with ‑a)cp -a src build/
mvmove or rename file/dirmv foo.txt bar.txt
rm ‑rfdelete recursively, no prompts; triple‑check path first!rm -rf build/
catdump file to stdout (pipe into less -R for paging)cat README.md
grep ‑rsearch recursively for string in filesgrep -r 'foo' src/
ssh -v user@hostsecure shell; -v prints handshake debugssh -v dev@10.0.0.5
sqlx migrate add <migration-name>create a new migration file with the given name.sqlx migrate add init-user
cargo checkcheck the code for errors without building it.cargo check
cargo fmtformat the code according to the Rust style guide.cargo fmt
cargo clippylint the code to find potential issues.cargo clippy
cargo buildbuild the code.cargo build
cargo runrun the code.cargo run
cargo testrun the tests.cargo test
cargo run -p <package>run a specific package.cargo run -p api
cargo add <package>add a new package to the project.cargo add tokio -F full

Further reading

  • “pwd” Linux man page
  • “env” command usage guide on Geeks‑for‑Geeks :contentReference[oaicite:1]{index=1}
  • PhoenixNAP’s cd primer :contentReference[oaicite:2]{index=2}
  • “ls” Linux man page :contentReference[oaicite:3]{index=3}
  • “mkdir(2)” Linux man page :contentReference[oaicite:4]{index=4}
  • Wikipedia’s overview of cp :contentReference[oaicite:5]{index=5}
  • LinuxCommand.org lesson on moving files :contentReference[oaicite:6]{index=6}
  • Tutorialspoint rm command guide :contentReference[oaicite:7]{index=7}
  • cat(1) Linux man page :contentReference[oaicite:8]{index=8}
  • freeCodeCamp tutorial on grep :contentReference[oaicite:9]{index=9}