The Z shell (Zsh) is a
Unix shell
A Unix shell is a Command-line_interface#Command-line_interpreter, command-line interpreter or shell (computing), shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command languag ...
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 mo ...
login
shell
Shell may refer to:
Architecture and design
* Shell (structure), a thin structure
** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses
Science Biology
* Seashell, a hard outer layer of a marine ani ...
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 command languages. Typical operations performed by shell scripts include file manipu ...
ing. Zsh is an extended
Bourne shell
The Bourne shell (sh) is a shell command-line interpreter for computer operating systems. It first appeared on Version 7 Unix, as its default shell. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic lin ...
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, command- ...
.
Zsh was created by Paul Falstad in 1990 while he was a student at
Princeton University
Princeton University is a private university, private Ivy League research university in Princeton, New Jersey, United States. Founded in 1746 in Elizabeth, New Jersey, Elizabeth as the College of New Jersey, Princeton is the List of Colonial ...
. It combines features from both
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, command- ...
, offering functionality such as 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 ...
, extended file
globbing, improved variable/array handling, and themeable
prompts.
Zsh is available for
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
as part of the
UnxUtils
UnxUtils is a collection of utility programs that provide popular Unix-based shell commands ported from GNU implementations as native Windows programs that depend only on Win32 and the Microsoft C- runtime ( msvcrt.dll). The collection wa ...
collection and has been adopted as the default shell for
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
and
Kali Linux
Kali Linux is a Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security. The software is based on the Debian''Testing'' branch: most packages Kali uses are imported from the De ...
. The "Oh My Zsh" user community website provides a platform for third-party plug-ins and themes, featuring a large and active contributor base.
History
Paul Falstad wrote the first version of Zsh in 1990 while a student at
Princeton University
Princeton University is a private university, private Ivy League research university in Princeton, New Jersey, United States. Founded in 1746 in Elizabeth, New Jersey, Elizabeth as the College of New Jersey, Princeton is the List of Colonial ...
. The name ''zsh'' derives from the name of
Yale
Yale University is a private Ivy League research university in New Haven, Connecticut, United States. Founded in 1701, Yale is the third-oldest institution of higher education in the United States, and one of the nine colonial colleges ch ...
professor Zhong Shao (then a teaching assistant at Princeton University) – Paul Falstad regarded Shao's
login
In computer security, logging in (or logging on, signing in, or signing on) is the process by which an individual gains access to a computer system or program by identifying and authenticating themselves.
Typically, user credential ...
, "zsh", as a good name for a shell.
Zsh was at first intended to be a subset of
csh for the
Amiga
Amiga is a family of personal computers produced by Commodore International, Commodore from 1985 until the company's bankruptcy in 1994, with production by others afterward. The original model is one of a number of mid-1980s computers with 16-b ...
, 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 for
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
as part of the
UnxUtils
UnxUtils is a collection of utility programs that provide popular Unix-based shell commands ported from GNU implementations as native Windows programs that depend only on Win32 and the Microsoft C- runtime ( msvcrt.dll). The collection wa ...
collection of
native
Native may refer to:
People
* '' Jus sanguinis'', nationality by blood
* '' Jus soli'', nationality by location of birth
* Indigenous peoples, peoples with a set of specific rights based on their historical ties to a particular territory
** Nat ...
Win32
The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
ports Ports collections (or ports trees, or just ports) are the sets of makefiles and Patch (Unix), patches provided by the BSD-based operating systems, FreeBSD, NetBSD, and OpenBSD, as a simple method of installing software or creating binary packages. T ...
of common
GNU
GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
Unix-like utilities.
In 2019,
macOS Catalina
macOS Catalina (version 10.15) is the sixteenth software versioning, 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 ...
adopted Zsh as the default login shell, replacing the
GPLv2
The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or copyleft, ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was th ...
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 Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security. The software is based on the Debian''Testing'' branch: most packages Kali uses are imported from the De ...
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 ...
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's C shell of 1978; ...
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 (non-
zero-based numbering
Zero-based numbering is a way of numbering in which the initial element of a sequence is assigned the index 0, rather than the index 1 as is typical in everyday non-mathematical or non-programming circumstances. Under zero-based number ...
)
* Editing of multi-line commands in a single buffer
*
Spelling correction and
autofill
Autocomplete, or word completion, is a feature in which an application software, application predicts the rest of a word a user is typing. In Android (operating system), Android and iOS smartphones, this is called predictive text. In graphical us ...
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. It first appeared on Version 7 Unix, as its default shell. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic lin ...
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 and
Unix domain socket
A Unix domain socket (UDS), a.k.a. local socket, a.k.a. inter-process communication (IPC) socket, is a communication endpoint for exchanging data between processes executing in the same Unix or Unix-like operating system.
The name, ''Unix domain ...
controls, an
FTP
The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and dat ...
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.
* Widgets. Both built and implemented by ordinary functions widgets can be bound to hotkeys.
* Function autoloading. A performance optimization for function that might be pre-loaded and run on demand. The intent of loading functions as separate file is also to support function features across different zsh versions.
Community

A user community website known as "Oh My Zsh" collects third-party plug-ins and themes for the Z shell. As of 2024, their
GitHub
GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
repository has over 2300 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
This article catalogs comparable aspects of notable operating system shell (computing), shells.
General characteristics
{, class="wikitable sortable sticky-header sort-under" style="width: auto; text-align: center; font-size: smaller;"
, -
...
References
External links
*
Oh My Zsh
{{Unix Shells
Scripting languages