Shell Tips
60 curated tips — shortcuts, workflows, and hidden features from Nirmal's Shell.
Type a directory name and press Enter to cd into it (AUTO_CD)
Use .. / ... / .... to go up 1/2/3 levels quickly
Use - to go back to your previous directory
Use pushd/popd and dirs -v for directory stack navigation
Use cd ~1 after dirs -v to jump back through your directory stack
Run ll for a long listing with hidden files and readable sizes
Run lt for a tree view up to 3 levels deep
Run glog for a visual git graph of the last 20 commits
Run gpr to pull with rebase for a cleaner history
Run gun to undo your last commit while keeping changes staged
Run gcount to see who contributed the most commits
Run croot to jump to the root of the current git repo
Run fbr to fuzzy-pick and checkout a git branch from local or remote refs
Use gs, gd, ga, gaa, gco, gb for quick git operations when the OMZ git plugin is enabled
Use ff <name> to find files by name recursively
Use ft <text> to search for text inside files (uses ripgrep if available)
Use ft TODO to quickly find TODO comments in your code
ff <pattern> [path] uses fd or fdfind when available for faster searches
Run extract <archive> to unpack a supported archive
Run mkcd <dir> to create a directory and cd into it in one step
Run path to print each PATH entry on its own line
Run dusage to see the largest items in the current directory
Run bigfiles to find the largest files recursively in the tree
Run dusage [path] [count] to summarize any directory with a custom limit
Run bigfiles [path] [count] to inspect any tree with a custom limit
Run fkill to fuzzy select and kill a process
Run fkill 15 to send SIGTERM and select multiple processes
Run ports to see all listening ports and their processes
Run myip to check your public IP address over HTTPS
Run weather to get a quick forecast over HTTPS
Run peek <file> to preview a file quickly
Run headers <url> to follow redirects and print response headers
Use global alias G anywhere: git log G fix pipes to grep
Use global alias L anywhere: cat file.txt L pipes to less
Use global alias W anywhere: ps aux W counts lines
Use global alias NE anywhere: command NE suppresses errors
Use global alias NUL anywhere: noisy-command NUL silences stdout and stderr
Combine globals: git log G fix W counts commits mentioning fix
Use **/*.ext for recursive glob matching (EXTENDED_GLOB)
* includes dotfiles because GLOB_DOTS is enabled
Use *(.m-1) to glob files modified in the last day
file2 sorts before file10 because NUMERIC_GLOB_SORT is enabled
History is shared across all open terminal sessions
Ctrl+R history search skips duplicate commands
Commands starting with a space are omitted from history (HIST_IGNORE_SPACE)
Command spell-correction prompts are intentionally disabled
Tab completion is case-insensitive for names and paths
Use z <pattern> to jump to directories zoxide remembers
Use zi for an interactive zoxide directory picker
Press Ctrl+R to fuzzy search your command history
Press Ctrl+T to fuzzy insert a file path at your cursor
Press Alt+C to fuzzy cd into a directory
Run npkg add bat for a short nix profile add command
Run npkg search ripgrep to search nixpkgs with package descriptions
Run npkg refresh to rebuild the cached nixpkgs picker index (requires jq)
Run npkg outdated to preview available package upgrades before running npkg upgrade
Run npkg install with no args to fuzzy-pick nixpkgs attribute names
Run npkg find nvim to seed the nix package picker with an initial query
npkg find shows description, version, and homepage in the preview pane
Run npkg remove with no args to fuzzy-select installed Nix packages to uninstall