zsh, one feature per page
Twenty-eight lessons on the features of the Z shell: what a feature is, reading the man pages, NOMATCH, EXTENDED_GLOB; file-type qualifiers, recursive globbing, exclude with ~, number ranges; array slices, counting backwards, associative arrays, substitution flags; integer bases, floating point, join forms, print -P; process substitution, named directories, autoload, zmodload; interactive comments, CORRECT, multiple redirections, buffer stack; ZDOTDIR, history controls, prompt conditionals, one honest hour; every claim traced to this box's rendered zsh manuals, its FAQ, or a captured zsh 5.9 run.
One feature, one page, one honest captured run. That is the shape of this book.
zsh, one feature per page
Twenty-eight lessons on the features of the Z shell: what a feature is, reading the man pages, NOMATCH, EXTENDED_GLOB; file-type qualifiers, recursive globbing, exclude with ~, number ranges; array slices, counting backwards, associative arrays, substitution flags; integer bases, floating point, join forms, print -P; process substitution, named directories, autoload, zmodload; interactive comments, CORRECT, multiple redirections, buffer stack; ZDOTDIR, history controls, prompt conditionals, one honest hour; every claim traced to this box's rendered zsh manuals, its FAQ, or a captured zsh 5.9 run.
Set in Space Grotesk, Inter and JetBrains Mono (SIL Open Font License).
An honest book about its demo: zsh 5.9 (x86_64-ubuntu-linux-gnu), dpkg package zsh 5.9-6ubuntu2 amd64, ran a twenty-five log feature sweep on the machine that built this book, captured 2026-12-01: globbing, arrays, parameters, arithmetic, substitution, modules, redirections, startup files, history options and prompt escapes, each run as a zsh -c capture kept verbatim. The machine ran no interactive session, typed no ZLE keystroke, installed no framework like oh-my-zsh, started no server and opened no port; buffer-stack, comment and CORRECT behavior is manual-quoted, the availability logs are quoted as-is, and every lesson that describes a practice exercise carries the label 'this book's plan'. Every quoted line is captured in /root/.hermes/cache/web/slot191park/zsh_demo_log1_version.txt through zsh_demo_log25_hist.txt; no output was invented. All other facts trace to this box's rendered zsh(1), zshexpn(1), zshparam(1), zshoptions(1) and zshmisc(1) pages, the maintainer's zsh.org FAQ, the zsh.org homepage, or the cached Wikipedia articles Z shell and Bash (Unix shell); dated FAQ notes are version-gated out loud where used. No facts from Reddit, Stack Overflow, vendor blogs or commercial sites. This book teaches the shell's documented vocabulary; it is not advice to change any login shell, and it describes plain zsh, not any framework. Independent, not affiliated with the zsh authors or the Wikimedia Foundation.
Your purchase is for personal use only. You do not have redistribution rights: please do not share, resell, or republish this book or its pages.
© 2026 Steve Hodgkiss. All rights reserved. Personal use only; no redistribution rights.
Edition 1.0 · stevehodgkiss.net
Contents
Per the zsh overview manual page, zsh - the Z shell; Because zsh contains many features, the zsh manual has been split into a number of sections. Per the zsh FAQ, Here are some things that zsh is particularly good at. Per a real run on the build machine captured at dispatch, zsh 5.9 (x86_64-ubuntu-linux-gnu). Per this book's plan, one page holds one feature the shell's own sources name, and twenty-eight pages name twenty-eight of them.
what a feature is
Zsh names its own subject: zsh - the Z shell, and the zsh manual has been split into a number of sections. The FAQ keeps its list: Here are some things that zsh is particularly good at.
The shell that ran every capture here printed zsh 5.9 (x86_64-ubuntu-linux-gnu), packaged as zsh 5.9-6ubuntu2 amd64. One page, one named thing: an option, an operator, a flag, an expansion.
Per this book's plan: one feature, one page, one honest capture.
Which items in the FAQ's feature list do you already use without knowing their names?
Per the zsh expansion manual page, Patterns used for filename generation may end in a list of qualifiers enclosed in parentheses. The qualifiers specify which filenames that otherwise match the given pattern will be inserted in the argument list; A qualifier may be any one of the following; plain files @ symbolic links; / directories. Per a real run on the build machine captured at dispatch, big.PNG notes.txt readme.md; link.txt; sub; print *(.); print *(@); print *(/). Per this book's plan, the three type qualifiers share one page because they are one feature: the qualifier set on a pattern.
file-type qualifiers
Globbing can ask about type, not just shape: patterns may end in a list of qualifiers enclosed in parentheses. The table names this page's three: plain files @ symbolic links, / directories.
One fixture folder, three patterns, three captured rows: big.PNG notes.txt readme.md for the dot, link.txt for the at-sign, sub for the slash.
A qualifier asks the filesystem, not the name.
In a folder with a link and a directory, run print *(.), then *(@), then *(/).
Per the zsh parameters manual page, A subscript of the form `[exp1,exp2]' selects all elements in the range exp1 to exp2, inclusive; The elements are numbered beginning with 1; $#param which substitutes the length of param. Per a real run on the build machine captured at dispatch, beta; gamma; 4; a=(alpha beta gamma delta); print -l $a[2,3]; print $#a. Per this book's plan, slice and count share one page because one run printed both answers: the two words, then the size.
array slices
The parameters page gives both halves: A subscript of the form `[exp1,exp2]' selects all elements in the range exp1 to exp2, inclusive, counted as in The elements are numbered beginning with 1, and counted by $#param which substitutes the length of param.
The run asked twice on a=(alpha beta gamma delta). print -l $a[2,3] answered beta then gamma; print $#a answered 4.
Count from one; slice with both ends; $# is never a guess.
Build a four-word array in one zsh -c and print $a[2,3] then $#a.
Per the zsh miscellany manual page, Integers may also be of the form `base#n', where base is a decimal number between two and thirty-six representing the arithmetic base and n is a number in that base (for example, `16#ff' is 255 in hexadecimal); The base# may also be omitted, in which case base 10 is used; any base specified in this way will be set as the variable's output arithmetic base. Per a real run on the build machine captured at dispatch, 255 10; 16#1F; 31; typeset -i hex=16#1e; print $hex; print $((hex)). Per this book's plan, the input base and the display base are one feature seen twice; the page keeps them together because one variable answered two printings differently.
integer bases
Numbers arrive in any base: Integers may also be of the form `base#n', where base is a decimal number between two and thirty-six - the page's own example prints 255 10 for the two arithmetic forms in the capture.
Display keeps the receipt: a base written on assignment will be set as the variable's output arithmetic base. The run set typeset -i hex=16#1e, stepped it, printed twice: 16#1F bare, 31 inside arithmetic.
The variable remembers its base. The expression prints decimal.
print $((16#ff)) then typeset -i a=16#ff; print $a in one zsh -c.
Per the zsh expansion manual page, Each part of a command argument that takes the form `<(list)', `>(list)' or `=(list)' is subject to process substitution; the system supports the /dev/fd mechanism; the file passed as an argument will be connected to the output of the list process. Per the Wikipedia article Bash (Unix shell), Process substitution, `<(...)', is not POSIX. Per a real run on the build machine captured at dispatch, 2c2; < two; ---; > three; exit=1; diff <(printf "one\ntwo\n") <(printf "one\nthree\n"). Per this book's plan, two temporary output streams became two filenames for diff, and the exit code came back in the same capture.
process substitution
Some programs insist on filenames. The expansion page hands one over: the file passed as an argument will be connected to the output of the list process, through the system supports the /dev/fd mechanism. The Wikipedia Bash article files it among the moves that are not POSIX.
The capture diffed two generators, no temp files, five whole lines: 2c2, < two, ---, > three, exit=1.
Angle-paren dresses a stream as a file.
Feed diff two generator lists with angle-paren arguments in one zsh -c.
Per the zsh options manual page, Allow comments even in interactive shells. Per a real run on the build machine captured at dispatch, hi; hi; setopt INTERACTIVE_COMMENTS; echo hi # trailing comment. Per this book's plan, this box ran both lines as zsh -c strings, where a hash already ends the line; no interactive prompt was typed and no ZLE keystroke sequence exists in any capture, so the option is quoted, not performed.
interactive comments
In scripts a hash starts a comment; at a prompt, by default, it does not. The options page, in full: Allow comments even in interactive shells.
The capture stays honest: both runs printed hi, twice, both typed as echo hi # trailing comment - but both ran as zsh -c strings, where the hash ends the line anyway. Per this book's plan: the option's stage is even in interactive shells, and no prompt was typed on this machine.
The feature waits for the prompt you type.
Read the INTERACTIVE_COMMENTS entry, then try echo hi # note at your own prompt.
Per the zsh overview manual page, zshroadmap Informal introduction to the manual. Per the zsh FAQ, A list of features is given in FEATURES, also with the source; Here are some things that zsh is particularly good at. Per the Wikipedia article Bash (Unix shell), The $EPOCHSECONDS and $EPOCHREALTIME shell variables are not POSIX. Per a real run on the build machine captured at dispatch, zsh 5.9 (x86_64-ubuntu-linux-gnu); 2026-12-01. Per this book's plan, the hour: pick one entry from the four manual sections this book quoted, read it, run that one feature in a single zsh -c, write down what printed, and say so plainly when your box answers differently.
one honest hour
Twenty-eight pages, twenty-eight named features - each quoted from a manual section the overview lists (start with zshroadmap Informal introduction to the manual) or printed by the sweep this machine ran on 2026-12-01.
Per this book's plan, the hour is small on purpose: pick one entry, read its sentences, run that one thing in a single zsh -c, and write what printed. Builds differ - helpers ship here and not there - and the difference is the lesson, not a defect.
Read one feature. Run one. Report what printed.
Choose the page you skimmed hardest; run its one-liner today and write the output.