The Z shell (Zsh) is a
Unix shell
A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating system t ...
that can be used as an
interactive
Across the many fields concerned with interactivity, including information science, computer science, human-computer interaction, communication, and industrial design, there is little agreement over the meaning of the term "interactivity", but m ...
login
shell and as a
command interpreter for
shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manip ...
ing. Zsh is an extended
Bourne shell
The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.
The Bourne shell was the default shell for Version 7 Unix. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic link ...
with many improvements, including some features of
Bash,
ksh, and
tcsh
tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell based on and backward compatible with the C shell (csh).
Shell
It is essentially the C shell with programmable command-line completion, comman ...
.
History
Paul Falstad wrote the first version of Zsh in 1990 while a student at
Princeton University
Princeton University is a private research university in Princeton, New Jersey. Founded in 1746 in Elizabeth as the College of New Jersey, Princeton is the fourth-oldest institution of higher education in the United States and one of the n ...
. The name ''zsh'' derives from the name of
Yale
Yale University is a private research university in New Haven, Connecticut. Established in 1701 as the Collegiate School, it is the third-oldest institution of higher education in the United States and among the most prestigious in the wo ...
professor Zhong Shao (then a teaching assistant at Princeton University) – Paul Falstad regarded Shao's
login-id, "zsh", as a good name for a shell.
Zsh was at first intended to be a subset of csh for the Commodore Amiga, but expanded far beyond that. By the time of the release of version 1.0 in 1990 the aim was to be a cross between ksh and tcsh – a powerful "command and programming language" that is well-designed and logical (like ksh), but also built for humans (like tcsh), with all the neat features like spell checking, login/logout watching and termcap support that were "probably too weird to make it into an AT&T product".
Zsh is available as a separate package for
Microsoft Windows as part of the
UnxUtils
UnxUtils is a collection of ports of common GNU Unix-like utilities to native Win32, with executables only depending on the Microsoft C- runtime msvcrt.dll. The collection was last updated externally on April 15, 2003, by Karl M. Syring. ...
collection of
native Win32
The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations ...
ports of common
GNU
GNU () is an extensive collection of free software
Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any ...
Unix-like utilities.
In 2019,
macOS Catalina
macOS Catalina (version 10.15) is the sixteenth major release of macOS, Apple Inc.'s desktop operating system for Macintosh computers. It is the successor to macOS Mojave and was announced at WWDC 2019 on June 3, 2019 and released to the p ...
adopted Zsh as the default login shell, replacing the
GPLv2
The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general u ...
licensed version of
Bash, and when Bash is run interactively on Catalina, a warning is shown by default.
In 2020,
Kali Linux
Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security.
Kali Linux has around 600 penetration-testing programs (tools), including Armitage (a g ...
adopted Zsh as the default shell since its 2020.4 release.
Features

Features include:
* Programmable
command-line completion
Command-line completion (also tab completion) is a common feature of command-line interpreters, in which the program automatically fills in partially typed commands.
Command line interpreters are programs that allow a user to interact with the u ...
that can help the user type both options and arguments for most used commands, with out-of-the-box support for several hundred commands
* Sharing of
command history
Command history is a feature in many operating system shells, computer algebra programs, and other software that allows the user to recall, edit and rerun previous commands.
Command line history was added to Unix in Bill Joy
William Nelson ...
among all running shells
* Extended
file globbing allows file specification without needing to run an external program such as
find
* Improved
variable/
array
An array is a systematic arrangement of similar objects, usually in rows and columns.
Things called an array include:
{{TOC right
Music
* In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
handling
* Editing of multi-line commands in a single buffer
*
Spelling correction and
autofill of command names (and optionally arguments, assumed to be file names)
* Various compatibility modes, e.g. Zsh can pretend to be a
Bourne shell
The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.
The Bourne shell was the default shell for Version 7 Unix. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic link ...
when run as
/bin/sh
* Themeable
prompts, including the ability to put prompt information on the right side of the screen and have it auto-hide when typing a long command
* Loadable modules, providing among other things: full
TCP
TCP may refer to:
Science and technology
* Transformer coupled plasma
* Tool Center Point, see Robot end effector
Computing
* Transmission Control Protocol, a fundamental Internet standard
* Telephony control protocol, a Bluetooth communication s ...
and
Unix domain socket
A Unix domain socket aka UDS or IPC socket ( inter-process communication socket) is a data communications endpoint for exchanging data between processes executing on the same host operating system. It is also referred to by its address family AF_U ...
controls, an
FTP client, and extended math functions.
* The built-in
where
command. Works like the
which
command but shows all locations of the target command in the directories specified in
$PATH
rather than only the one that will be used.
* Named directories. This allows the user to set up shortcuts such as
~mydir
, which then behave the way
~
and
~user
do.
Community

A user community website known as "Oh My Zsh" collects third-party plug-ins and themes for the Z shell. As of 2021, their
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
repository has over 1900 contributors, over 300 plug-ins, and over 140 themes. It also comes with an auto-update tool that makes it easier to keep installed plug-ins and themes updated.
See also
*
Comparison of command shells
A command shell is a command-line interface to interact with and manipulate a computer's operating system.
General characteristics
Interactive features
Background execution
Background execution allows a shell to run a command without us ...
References
External links
*
*
ZSH Wiki*
{{Unix Shells
Scripting languages