Master command-line productivity, custom aliases, zsh plugins, tmux multiplexing, jq JSON manipulation, ripgrep code searching, and git CLI efficiency.
The terminal is the ultimate developer interface. Mastering CLI tools transforms complex file processing, git operations, and server management into effortless single-line commands.
Modern CLI utilities like `fzf` (fuzzy finder), `ripgrep` (`rg`), `bat`, `zoxide`, and `jq` allow you to query, edit, search, and navigate local and remote file systems 10x faster than traditional GUI file managers.
Master high-speed terminal file searching with `ripgrep` and interactive history filtering with `fzf`.
Parse and transform JSON API payloads directly in the terminal using `jq`.
Streamline git workflows using interactive aliases, zsh autosuggestions, and Starship prompt.
Manage multi-pane persistent terminal sessions using `tmux` for remote server development.
Ripgrep searches gigabytes of code in milliseconds without heavy indexing.
Essential skill for Cloud Run, EC2, Kubernetes, and DevOps troubleshooting.
Unix pipes allow chaining tools together to automate complex data pipelines.
A DevOps engineer used `curl -s https://api.prod.com/health | jq .status` and `rg "500 Internal Server Error" server.log | wc -l` to quantify error spikes instantly.
Impact: Identified the failing microservice in 45 seconds without needing slow Web UI log viewers.
✗ Bad Approach
Opening VS Code global search, waiting for indexing, clicking through individual search result tabs slowly.
Why it failed: Slow on huge codebases and unhelpful when working over SSH on remote Linux servers.
✓ Better Approach
Running `rg "TOKEN_EXPIRED_ERROR" src/` in the terminal.
Why it works: Returns exact line numbers and highlighted matches across all files in 15 milliseconds.
Key Takeaway: Ripgrep (`rg`) respects `.gitignore` automatically and is significantly faster than standard grep or IDE search.
❯ Navigation & File Inspection
z <dir-substring>Fuzzy jump to frequently accessed directory anywhere on disk using zoxide.
$ z projLearns your habits over time. No need to type full relative/absolute paths.
eza -la --icons --gitModern colorized directory list showing hidden files, permissions, and git status.
$ eza -la --iconsbat <filename>Syntax-highlighted cat replacement with line numbers and git diff markers.
$ bat package.jsondu -sh * | sort -rh | head -n 10List top 10 largest folders/files in current directory.
$ du -sh * | sort -rhncduInteractive TUI disk usage analyzer to navigate and delete large files/folders.
$ ncdu ~tree -L 2 -I "node_modules|.git"Print visual directory tree up to 2 levels deep, ignoring heavy build folders.
$ tree -L 2 -I "node_modules"cd -Jump back to the previously visited directory in one keystroke.
$ cd -Works beautifully with `cd` toggling — `cd -` + `cd -` bounces between your two most-used folders.
find . -type f -mtime -2List files modified within the last 2 days for quick change review.
$ find src -type f -mtime -1wc -l <file>Count lines in a file — perfect for logs, CSVs, or checking dataset sizes.
$ wc -l server.logfile <path>Detect the real file type of any binary, archive, or extensionless file.
$ file download.bin❯ Search & Text Filtering (Ripgrep & fzf)
rg "search_term" src/Sub-second text search across files respecting .gitignore automatically.
$ rg "useCallback" src/rg -i -g "*.ts" "error"Case-insensitive search filtered exclusively to .ts files.
$ rg -i -g "*.ts" "error"rg -l "API_KEY"List only the filenames containing the string match without line contents.
$ rg -l "API_KEY"rg --files | fzfInteractive fuzzy file picker piping all repo files into fzf.
$ rg --files | fzffd --extension tsxFast rust-powered file finder matching file extensions.
$ fd --extension tsxhistory | fzfInteractively search through all past shell commands with fuzzy finder.
$ history | fzfrg -n -C 3 "TODO" src/Show 3 lines of surrounding context for each match with line numbers.
$ rg -n -C 2 "FIXME"rg --type ts "interface"Restrict a search to a specific language using built-in type filters.
$ rg -tjs "export default"rg --files | fzf --preview "bat --color=always {}"File picker with instant syntax-highlighted content preview inside fzf.
$ rg --files | fzf --preview "bat --no-pager {}"❯ JSON Processing (jq)
curl -s https://api.github.com/users/octocat | jq .Pretty print JSON API response with color syntax highlighting.
$ curl -s https://api.github.com/users/octocat | jq .cat package.json | jq .dependenciesExtract specific top-level JSON key.
$ cat package.json | jq .dependenciescat package.json | jq -r .nameExtract raw string value without surrounding quote marks.
$ cat package.json | jq -r .namecat users.json | jq '.[] | select(.active == true) | .email'Filter JSON array of objects by condition and extract target field.
$ jq '.[] | select(.active == true)'cat data.json | jq keysList all top-level keys of a JSON object.
$ cat package.json | jq keyscat data.json | jq lengthCount items in an array or keys in an object.
$ cat users.json | jq lengthcat data.json | jq 'sort_by(.score) | .[-1]'Sort a list by a field and take the last element — handy for leaderboards.
$ jq 'sort_by(.stars) | .[-1]' repos.jsoncat data.json | jq -r '.[] | "(.name): (.version)"'Build custom-formatted output rows from multiple JSON fields.
$ jq -r '.[] | "(.name)@(.version)"' package-lock.json❯ Terminal Multiplexer (tmux)
tmux new -s devStart a new named tmux multiplexer session.
$ tmux new -s devtmux attach -t devRe-attach to an existing persistent background tmux session.
$ tmux attach -t devtmux lsList all running tmux background sessions.
$ tmux lsCtrl+b %Split current tmux window vertically into side-by-side panes.
$ Press Ctrl+b then %Ctrl+b "Split current tmux window horizontally.
$ Press Ctrl+b then "Ctrl+b dDetach from current tmux session without stopping background processes.
$ Press Ctrl+b then dCtrl+b cCreate a brand new window inside the current tmux session.
$ Press Ctrl+b then cCtrl+b wOpen an interactive list of all windows and sessions to jump between.
$ Press Ctrl+b then wCtrl+b zZoom the current pane to fill the entire terminal; press again to un-zoom.
$ Press Ctrl+b then ztmux kill-serverShut down every tmux session and pane on the machine.
$ tmux kill-server❯ Git CLI Power Shortcuts
git log --oneline --graph --all --decorateCompact ASCII visual commit graph history.
$ git log --oneline --graphgit checkout -Jump back to the previously checked out git branch instantly.
$ git checkout -git branch --merged | grep -v "\*" | xargs git branch -dClean up all local branches that have already been merged into main.
$ git branch --mergedgit diff --stagedInspect exact line changes staged for the next commit.
$ git diff --stagedgit stash push -m "WIP feature"Stash uncommitted changes with a descriptive label.
$ git stash push -m "WIP feature"git clean -fdRemove all untracked files and directories safely.
$ git clean -fdgit add -pInteractively stage individual hunks of a file — commit only the parts you want.
$ git add -p src/App.tsxgit reflogPrint every recorded branch position — the recovery tool for "lost" commits.
$ git reflog`git reset --hard HEAD@{3}` recovers work that went missing after a bad reset.
git reset --soft HEAD~1Undo the last commit while keeping all changes staged.
$ git reset --soft HEAD~1git log -S "TODO"Pickaxe search — find commits where the count of a specific string changed.
$ git log -S "apiKey"git blame -L 20,40 src/main.tsAttribute author and commit to every line in a specific range.
$ git blame -L 1,10 README.md❯ Shell History & Line Editing Keybindings
Ctrl + RReverse interactive search in command history.
$ Press Ctrl+R and type part of commandCtrl + AMove cursor directly to the beginning of the line.
$ Press Ctrl+ACtrl + EMove cursor directly to the end of the line.
$ Press Ctrl+ECtrl + UClear entire command line from cursor back to beginning.
$ Press Ctrl+UCtrl + WDelete previous word before cursor.
$ Press Ctrl+W!!Execute the previous command again (useful with sudo: `sudo !!`).
$ sudo !!!$Reuse the last argument of the previous command.
$ mkdir my_folder && cd !$Ctrl + P / Ctrl + NMove backward / forward through shell history without touching the mouse.
$ Press Ctrl+P for previous commandCtrl + LClear the terminal screen while keeping the current command line.
$ Press Ctrl+L❯ SSH & Remote Development
ssh-keygen -t ed25519 -C "you@email.com"Generate a modern, secure Ed25519 SSH key pair for github/remote logins.
$ ssh-gen -t ed25519 -C "dev@corp.com"ssh-copy-id user@server.comInstall your public SSH key on a server enabling password-less logins.
$ ssh-copy-id deploy@10.0.0.5ssh -N -L 8080:localhost:80 user@server.comForward a local port to a remote service through an SSH tunnel.
$ ssh -L 3000:localhost:3000 user@serverscp -r ./build user@server.com:~/distCopy a local folder to a remote host securely.
$ scp -r ./build root@1.2.3.4:~/distrsync -az --progress ./src user@server.com:~/backupIncremental sync of folders over SSH that skips unchanged files.
$ rsync -az ./dist user@host:~/app/ssh -t user@server.com "cd /srv/app && bash"Run commands on the remote host and keep an interactive terminal session.
$ ssh -t user@host "cd /srv && ./deploy.sh"Pipe command outputs into `fzf` for interactive searching across files, history, git commits, and process lists.
Replaces tedious history scrolling and directory clicking.
Define custom aliases in `.zshrc` or `.bashrc` for frequent multi-flag commands (e.g., `alias gsw="git switch"`).
Saves thousands of keystrokes weekly across repetitive tasks.
Slice, filter, map, and transform JSON data from curl responses or config files on the fly.
Crucial for inspecting API responses without leaving the terminal.
Run multiple terminal panes, windows, and persistent background sessions inside a single SSH connection.
Sessions persist even if your local network disconnects.
Simplifies SSH connections to university Linux servers and execution of automated build scripts.
Enables instant deployment scripts, log streaming, and curl API debugging under tight deadlines.
Helps you troubleshoot Docker logs, environment variables, and git rebase issues independently.
Essential for DevOps, cloud infrastructure management (AWS, GCP, Cloud Run), and CI/CD pipeline automation.
Allows fluid remote server management over SSH without needing bandwidth-heavy GUI remote desktops.
Chain simple, focused CLI utilities together using standard input/output streams (`|`):
Upgrade your terminal with modern Rust-powered CLI tools.
Replace legacy UNIX utilities with modern equivalents for instant speedups and syntax highlighting.
Filter and format JSON payloads effortlessly.
Learn fundamental jq filter expressions for extracting values from API responses.
Re-typing long complex commands from scratch every time
Use `Ctrl + R` (or fzf) to fuzzy search command history or save the command as a shell alias.
Manual re-typing leads to typos and wastes valuable developer time.
Commit your `.zshrc`, `.bashrc`, `.tmux.conf`, and custom aliases to a private Git repository.
Tip: Enables 1-command setup whenever you switch to a new laptop or cloud development server.
High-Productivity .zshrc Aliases Template
# GIT ALIASES alias g="git" alias gs="git status" alias gsw="git switch" alias gcb="git switch -c" alias gcm="git commit -m" alias gpo="git push origin HEAD" alias gl="git log --oneline --graph --decorate" # NAVIGATION & TOOLS alias z="zoxide" alias cat="bat" alias ls="eza --icons" alias reload="source ~/.zshrc" # DOCKER RECLAIM alias dprune="docker system prune -a --volumes"
Copy these aliases into your shell config file to instantly boost CLI speed.
stdout (standard output, file descriptor 1) handles standard program output stream, whereas stderr (standard error, file descriptor 2) routes error messages separately.
The terminal is a power multiplier when enhanced with modern utilities like ripgrep, fzf, and jq.
Automate repetitive command sequences with shell aliases and dotfiles.
Chaining simple Unix utilities with pipes allows building powerful automated workflows on the fly.
TERMINAL: MASTERED
“The terminal doesn't judge. It just executes exactly what you tell it. Learn to speak its language.”