zsh vs bash for SREs
Shell choice. Productivity differences.
zsh
zsh and bash are the two most common shells. zsh is feature-rich and ergonomic; bash is universal and portable. The discipline is using each where it fits: zsh for interactive use, bash for scripts.
What zsh provides:
- Better autocomplete.: zsh's completion system is much richer than bash's. Context-aware completion, intelligent suggestions, fuzzy matching all are built in or available through plugins.
- Plugin ecosystem.: oh-my-zsh, prezto, and similar frameworks provide extensive plugin ecosystems. The team gets git integration, command suggestions, custom prompts, syntax highlighting all easily.
- Default on macOS.: Apple ships zsh as the default shell on macOS. Many engineers' primary machines have zsh; the familiarity is built in.
- Common on dev workstations.: Even on Linux, zsh is increasingly common as the default interactive shell. The team's preferences shape the workstation; productivity is the goal.
- Powerful glob patterns.: zsh's glob patterns are richer than bash's. Recursive glob (asterisk-asterisk), exclusions, qualifiers all are available without external tools.
zsh is the interactive choice. The ergonomics produce real productivity gains.
bash
bash is universal. Linux servers, scripts in repositories, CI runners all have bash. The portability is the value.
- Universal.: bash is everywhere. Every Linux server has it; many tools assume it; scripts depending on bash work across environments.
- Default on most Linux servers.: Most Linux distributions ship bash as the default. SSH into a server; bash is what the team gets; the tool is universal.
- Scripts portable.: bash scripts work on macOS, Linux, BSD, anywhere bash is installed. The portability simplifies the team's tooling distribution.
- Cross-platform.: Beyond Linux, bash works on Windows (via WSL or Git Bash), macOS, and other platforms. The team's scripts have broad reach.
- POSIX compliance.: Most bash scripts also run under POSIX-compliant shells (sh, dash). Greater portability than zsh-specific scripts.
bash is the script choice. The portability is essential for shared scripts.
Policy
The team's policy uses each where it fits. zsh as interactive shell on workstations; bash for scripts that need to run anywhere.
- zsh as interactive shell.: Engineers' interactive use is in zsh. The completion, plugins, ergonomics produce productivity. The team's workstations default to zsh.
- bash for scripts.: Scripts in repositories use bash. They run on the team's CI; they run on production servers; they run on engineers' workstations regardless of interactive shell.
- Scripts run anywhere.: Bash scripts work in all the team's environments. The team's tooling does not care about engineer's shell preferences; the scripts are portable.
- Interactive ergonomics on workstation.: Engineers customize their workstation shell. The interactive experience is theirs to optimize; the team's discipline does not constrain interactive use.
- Document the policy.: The team's discipline is documented. New engineers understand: scripts in bash; interactive in zsh; the consistency supports onboarding.
zsh vs bash is one of those tooling preferences with clear discipline. Nova AI Ops integrates with infrastructure observability, complementing local-tool preferences with cluster-wide visibility.