

Bash is the default login shell on most Linux systems, and it remains the most portable choice for scripts. For interactive use, however, Zsh (Z Shell) adds features that Bash does not have by default: history-based suggestions, syntax highlighting, and a prompt that can show Git status and other context.
This guide covers installing Zsh with Pixi, which does not require administrator rights, then configuring Oh My Zsh, a few plugins and a theme. The same setup works on Linux, macOS, WSL, and HPC clusters, and the configuration can be kept in a dotfiles repository.
After completing this setup, the terminal will have:
sudo is not available, including HPC clusters
Zsh is a shell designed for interactive use that extends Bash with:
**/*.txtFor daily interactive terminal work, Zsh is a reasonable upgrade. For scripts, Bash remains the more portable choice, since it is available almost everywhere by default.
Pixi global install can install Zsh without sudo or administrator access. This works on Linux, macOS, WSL and HPC clusters.
Before installing Zsh with Pixi:
Verify Pixi is ready:
pixi --version# Should output: pixi X.X.XThe installation is a single command:
# Install Zsh globally from conda-forgepixi global install zsh --channel conda-forgeAfter installation, open a new terminal or reload the current one:
# Option 1: Open a new terminal window# Close current terminal and open a new one
# Option 2: Reload current terminalexec bash
# Then verify Zsh is availablezsh --version
# Check where it's installedwhich zsh# Output: $HOME/.pixi/bin/zsh
# Launch ZshzshPixi adds ~/.pixi/bin to PATH in new terminals automatically.
# Update Zsh to latest versionpixi global upgrade zsh
# Reinstall with specific versionpixi global install zsh==5.9 --channel conda-forge --force
# List all globally installed packagespixi global list
# Check Zsh versionzsh --versionpixi global install for Zsh?PATH export neededpixi global upgradeWith Zsh installed through Pixi, Oh My Zsh can manage plugins and themes.
Oh My Zsh is an open-source framework for managing Zsh configuration. It provides:
.zshrc fileThe main advantage is that it avoids writing complex Zsh configuration from scratch and offers community-maintained plugins and themes that work across Linux, macOS and WSL.
# Install via curlsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Or via wgetsh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"What happens:
~/.oh-my-zsh/ directory~/.zshrc to ~/.zshrc.pre-oh-my-zsh~/.zshrc with the default Oh My Zsh configurationVerify the installation:
# Open a new terminal (or run)exec zsh
# You should see a colorful prompt with Oh My Zsh.zshrc fileThe ~/.zshrc file is Zsh's configuration file, analogous to .bashrc for Bash:
# Open in your favorite editornano ~/.zshrc# orvim ~/.zshrc# orcode ~/.zshrc # VS CodeKey sections in .zshrc:
# Path to Oh My Zsh installationexport ZSH="$HOME/.oh-my-zsh"
# Theme configurationZSH_THEME="robbyrussell"
# Plugins to loadplugins=(git)
# Load Oh My Zshsource $ZSH/oh-my-zsh.sh
# Your custom aliases and functions go belowApply changes:
# After editing .zshrc, reload configurationsource ~/.zshrcOh My Zsh includes several plugins. The Git and Docker plugins can be enabled in ~/.zshrc:
plugins=( git # Git aliases: gst, ga ., gcmsg, gp, gl, glol docker # Docker aliases: dps, di, dstop)Reload:
source ~/.zshrcTwo external plugins are commonly added:
Shows suggestions from history as text is typed (in grey). Press the right arrow to accept.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Add to ~/.zshrc pluginsplugins=(... zsh-autosuggestions)source ~/.zshrcUsage:
# Type a previous command prefixgit c<press right arrow> # Auto-completes: git commit
# Cycle through suggestionsgit <press up/down> # Cycle through previous 'git' commandsHighlights commands as they are typed: green for valid, red for invalid.
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Add to ~/.zshrc plugins (must be LAST)plugins=(... zsh-syntax-highlighting)source ~/.zshrcThis helps catch typos before pressing Enter.
# Edit ~/.zshrcplugins=( git docker zsh-autosuggestions zsh-syntax-highlighting)
source ~/.zshrcPowerlevel10k is a popular Zsh theme with Git status, Python version and an interactive configuration wizard.
# Installgit clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# Set in ~/.zshrcZSH_THEME="powerlevel10k/powerlevel10k"
# Reload - configuration wizard will launchsource ~/.zshrcThe prompt can show:
┌──(user@hostname)-[~/my-repo]-[main ✓]-[🐍 3.11.4]└─$main ✓ - the Git branch with its status🐍 3.11.4 - the active Python version✓ (clean), ! (changes), + (staged)Reconfigure at any time:
p10k configureWith Oh My Zsh's Git plugin and the Powerlevel10k theme:
Git aliases (from the git plugin):
# Common commandsgst # git statusga . # git add .gcmsg # git commit -m "message"gp # git pushgl # git pullgco # git checkoutgcb # git checkout -b (new branch)glog # git log --oneline --graphGit status in the prompt:
# Your prompt shows:~/my-repo (main ✓) # Clean repo~/my-repo (main !) # Uncommitted changes~/my-repo (feat/new-feature +) # Staged changesView all Git aliases:
alias | grep gitEnable the docker and docker-compose plugins:
plugins=(... docker docker-compose)Docker aliases:
# Common commandsdps # docker psdi # docker imagesdex # docker exec -itdstop # docker stopdrm # docker rmdrmf # docker rm -fDocker autocomplete:
docker <TAB> # Shows all commandsdocker run <TAB> # Shows imagesdocker exec <TAB> # Shows running containersA dotfiles repository can keep the Zsh configuration the same on a laptop and an HPC cluster. Since HPC clusters usually mount home directories over NFS, the configuration is then available on compute nodes as well.
On the laptop:
# Create dotfiles directorymkdir -p ~/dotfilescd ~/dotfiles
# Initialize Gitgit init
# Copy your Zsh configcp ~/.zshrc zshrc
# Add and commitgit add zshrcgit commit -m "Initial commit: Zsh config"
# Create GitHub repo and pushgit remote add origin https://github.com/yourusername/dotfiles.gitgit branch -M maingit push -u origin mainOn the laptop or HPC login node (after cloning):
# Clone dotfilesgit clone https://github.com/yourusername/dotfiles.git ~/dotfiles
# Create symlink to Zsh configrm ~/.zshrc # Backup original if neededln -s ~/dotfiles/zshrc ~/.zshrc
# Verifycat ~/.zshrc | head -5Most HPC clusters mount home directories over NFS, so the ~/dotfiles repository is available on compute nodes without additional setup.
# On HPC login nodegit clone https://github.com/yourusername/dotfiles.git ~/dotfilesln -s ~/dotfiles/zshrc ~/.zshrc
# Your config is now available on all compute nodes via shared home!# Launch Zsh on any node:zshBenefits for HPC:
git pull in ~/dotfiles# Edit ~/.zshrc on desktopnano ~/.zshrc
# Commit and push changescd ~/dotfilesgit add zshrcgit commit -m "Update: Add new alias"git push
# On HPC, pull latest configcd ~/dotfilesgit pull
# Changes take effect in new terminal sessionexec zshThe shell is now configured with Zsh and Oh My Zsh, without administrator privileges, and the same configuration can be used on a laptop, under WSL and on an HPC cluster.
Suggested next steps:
~/.zshrc to a dotfiles repository (section 7)alias | grep git to list the aliases from the pluginRelated posts:





