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.
| Command | Cheat‑description | Example |
|---|---|---|
pwd | prints full path of current directory | pwd |
env | dumps environment variables (useful for debugging config) | env | grep DATABASE |
cd | change directory (cd ‑ jumps back) | cd ~/projects |
ls ‑la | list files, humans size, dotfiles visible, colorized by default | ls -la ~/Downloads |
mkdir ‑p | make directory, parents if needed | mkdir -p tmp/cache |
cp ‑a | copy file/dir, preserve perms (-r not needed with ‑a) | cp -a src build/ |
mv | move or rename file/dir | mv foo.txt bar.txt |
rm ‑rf | delete recursively, no prompts; triple‑check path first! | rm -rf build/ |
cat | dump file to stdout (pipe into less -R for paging) | cat README.md |
grep ‑r | search recursively for string in files | grep -r 'foo' src/ |
ssh -v user@host | secure shell; -v prints handshake debug | ssh -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 check | check the code for errors without building it. | cargo check |
cargo fmt | format the code according to the Rust style guide. | cargo fmt |
cargo clippy | lint the code to find potential issues. | cargo clippy |
cargo build | build the code. | cargo build |
cargo run | run the code. | cargo run |
cargo test | run 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
cdprimer :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
rmcommand 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}