← All 191 books zsh, one feature per page
One feature per page

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.


Steve Hodgkiss 7 lessons

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

Contents


Part 1 · Before the feature list
what a feature is4
Part 2 · Globbing
file-type qualifiers5
Part 3 · Parameters
array slices6
Part 4 · Numbers and strings
integer bases7
Part 5 · The shell at work
process substitution8
Part 6 · Typing and fixing
interactive comments9
Part 7 · Config and the honest hour
one honest hour10

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.

zsh companion · No. 01
the unit

what a feature is

the unit of this book

the list names the unit: one feature, one pagethe FAQ's feature list:recursive globbingNamed directoriesSpelling correctioneach bullet is a whole shell featurethis book's unitone named feature,one page, one capturetwenty-eight timeszsh 5.9 (x86_64-ubuntu-linux-gnu)the pages ahead each take one line of that list seriously

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.

SPEND ONE HONEST HOUR

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.

zsh companion · No. 02
the qualifiers

file-type qualifiers

(.) files (@) links (/) dirs

one folder, three type questions(.)plain filesbig.PNGnotes.txtreadme.mdthe captured row(@)symbolic linkslink.txtthe captured row(/)directoriessubthe captured rowthe qualifiers pick which of the shape-matches surviveshape first, then type: dot, at, slash

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.

SPEND ONE HONEST HOUR

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.

zsh companion · No. 03
the slice

array slices

$a[2,3] and how many

a slice keeps both ends namedalphabetagammadelta$a[2,3]betagamma$#a4length, not a guessnumbering starts at one; both ends of the slice are kepttwo words out of the middle, then the count of all of them

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.

SPEND ONE HONEST HOUR

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.

zsh companion · No. 04
the base

integer bases

16#ff is 255

the input base survives into the display$((16#ff)) $((2#1010))255 10two bases read in, onecaptured decimal line outtypeset -i hex=16#1eprint $hex16#1Fprint $((hex))31the same value, two facesa base written on assignment becomes the output base

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.

SPEND ONE HONEST HOUR

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.

zsh companion · No. 05
the angle pipe

process substitution

diff <(...) <()

two streams, one diff, zero temp filesprintf one, twoprintf one, three<(list)<(list)diff2c2< two---> threeexit=1the exit status, in the capturethe angle argument is a file to the command, a stream to the shell

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.

SPEND ONE HONEST HOUR

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.

zsh companion · No. 06
the typed hash

interactive comments

the option for typed #

the capture ran strings, not a promptecho hi # trailing commenthino option setecho hi # trailing commenthisetopt INTERACTIVE_COMMENTSthe option acts at typed promptsno interactive session ran on this boxboth runs answered hi; the strings parse comments either wayquoted from the options page: allow comments even in interactive shells

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.

SPEND ONE HONEST HOUR

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.

zsh companion · No. 07
the close

one honest hour

the close: read one feature, run one

one honest hour: read one, run one, write itreadone entry, four sectionsrunone line, one zsh -cwritewhat printed, plainlyzsh 5.9 (x86_64-ubuntu-linux-gnu)twenty-eight features were captured on that box, one page at a timeyour hour buys the same honesty: one feature, one line, one answerread one feature, run one feature, report what printed

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.

SPEND ONE HONEST HOUR

Choose the page you skimmed hardest; run its one-liner today and write the output.

Index

Index


array slices6
file-type qualifiers5
integer bases7
interactive comments9
one honest hour10
process substitution8
what a feature is4