zsh (Z Shell) Reference

Kip Landergren

(Updated: )

Contents#

Parameters#

HISTFILE where to save the history
SAVEHIST number of lines of your history you want saved
HISTSIZE the number of lines the shell will keep within one session
LISTMAX the number of matches to list without asking first

Options#

INC_APPEND_HISTORY each line is added to the history as it is executed (not just on shell exit)
EXTENDED_HISTORY include start time and how long it ran for
HIST_REDUCE_BLANKS tidy up the line by removing any excess blanks that mean nothing to the shell
HIST_IGNORE_SPACE lines which begin with a space don't go into the history
MENU_COMPLETE first tab press on ambiguous cd completes
AUTO_MENU second tab press on ambiguous cd cycles through options

Functions#

# align forward / backward word behavior with emacs'
autoload -U select-word-style
select-word-style bash

Environment Variables#

CPUTYPE
ZSH_VERSION

Important Locations#

macOS#

/usr/local/share/zsh/site-functions/ (?? standard ??) install location of zsh completions

Common Operations#

Reload zsh#

exec zsh

Reload only interactive configuration / Reload .zshrc#

source ~/.zshrc

Reload only environment / Reload .zshenv#

source ~/.zshenv

Resources#

Frequently Asked Questions (FAQs)#

What is the difference between zsh 4 and zsh 5?#

Read the section “New features between zsh versions 4.2 and 5.0” of the release notes.

Terminology#

event#
1.

Item in the history list.

globbing#
1.

The way filenames are expanded; derived from phrase: global replacement.

Related:

option#
1.
parameter#
1.
parameter expansion#
1.