Last reviewed
Zsh for Programmers
Zsh (the Z shell) is the shell I use. It runs nearly everything you'd write for bash, and adds a lot of small things that make the command line nicer to live in. It has been the default shell on macOS since Catalina, and on most Linux distributions it's a quick package install away. See the install guides for the commands.
What makes it worth using
Tab completion
Press tab after a command, a path, or even a flag, and zsh suggests what can go there based on context. It saves a lot of typing and saves looking up options you only half remember.
Better globbing
You can often skip find altogether:
ls **/*.md # every markdown file, in this directory and below
ls *.(md|txt) # .md and .txt files
ls *(/) # directories only
ls *(.m-7) # regular files modified in the last 7 daysHistory
History can be shared between open shells, so a command you ran in one pane is available in the next, and duplicates can be dropped so that searching stays useful.
Corrections and shortcuts
Zsh can offer to fix a mistyped command, and you can change directories by just typing the directory's name.
These options turn on the history and correction behavior above. They go in your ~/.zshrc:
setopt SHARE_HISTORY # share history between open shells
setopt HIST_IGNORE_ALL_DUPS # drop older duplicate commands
setopt CORRECT # offer to fix mistyped commands
setopt AUTO_CD # type a directory name to cd into itPlugins and prompts
Most of what people show off in zsh comes from its plugin ecosystem:
- Oh My Zsh — the big framework, with plugins for git, nvm and much more, plus themes
- zsh-autosuggestions — suggests commands from your history as you type
- zsh-syntax-highlighting — colors commands as you type, so typos stand out before you press enter
- Powerlevel10k — a fast, configurable prompt that can show your directory, git status and more
- Starship — a similar idea to Powerlevel10k, but it works across shells
Don't install everything at once. Every plugin adds to your shell's startup time, so add them as you find you need them.
Shortcut keys for moving around the command line
These are worth learning, because they work in bash too.

