Software:Z shell

From HandWiki
Short description: Unix shell
Z shell
Z Shell Logo Color Horizontal.svg
Zsh 5.8 screenshot.png
Screenshot of a Zsh session
Original author(s)Paul Falstad[1]
Developer(s)Peter Stephenson, et al.[1]
Initial release1990; 34 years ago (1990)
Stable release
5.9 / May 14, 2022; 2 years ago (2022-05-14)[2]
Written inC
Operating systemCross-platform
TypeUnix shell
LicenseMIT-Modern-Variant[3][4]
Websitewww.zsh.org

The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.

Zsh was created by Paul Falstad in 1990 while he was a student at Princeton University. It combines features from both ksh and tcsh, offering functionality such as programmable command-line completion, extended file globbing, improved variable/array handling, and themeable prompts.

Zsh is available for Microsoft Windows as part of the UnxUtils collection and has been adopted as the default shell for macOS and Kali Linux. 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[5] while a student at Princeton University.[6] The name zsh derives from the name of Yale 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.[7][8]

Zsh was at first intended to be a subset of csh for the 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".[9]

Zsh is available for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.[10]

In 2019, macOS Catalina adopted Zsh as the default login shell, replacing the GPLv2 licensed version of Bash,[11] and when Bash is run interactively on Catalina, a warning is shown by default.[12]

In 2020, Kali Linux adopted Zsh as the default shell since its 2020.4 release.[13]

Features

Z shell's configuration utility for new users
Zsh with Agnoster theme running on Konsole terminal emulator

Features include:[14]

  • Programmable command-line completion 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 among all running shells
  • Extended file globbing allows file specification without needing to run an external program such as find
  • Improved variable/array handling (non-zero-based numbering)
  • 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 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 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.
  • Widgets. Both built and implemented by ordinary functions widgets can be bound to hotkeys.

Community

Oh My Zsh logo

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 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.[15]

See also

References

  1. 1.0 1.1 "The Z Shell Manual". Sourceforge.io. July 21, 2012. https://zsh.sourceforge.io/Doc/Release/Introduction.html#Author. 
  2. "unposted: Release 5.9". sourceforge.net. May 14, 2022. https://sourceforge.net/p/zsh/code/ci/73d317384c9225e46d66444f93b46f0fbe7084ef/. 
  3. "zsh / Code / [281031] /LICENCE". Paul Falstad. http://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE. 
  4. "MIT License Modern Variant". https://spdx.org/licenses/MIT-Modern-Variant.html. 
  5. "zsh - a ksh/tcsh-like shell (part 1 of 8)". alt.sources. December 14, 1990. http://groups.google.com/group/alt.sources/msg/936c7876941058ed. 
  6. "Z-Shell Frequently-Asked Questions". Sourceforge.net. February 15, 2010. http://zsh.sourceforge.net/FAQ/zshfaq01.html#l3. 
  7. "The Z-Shell (ZSH) Lovers' Page". Guckes.net. c. 2004. http://www.guckes.net/zsh/lover.html. 
  8. "Zsh Mailing List Archive". Zsh.org. August 8, 2005. http://www.zsh.org/mla/users/2005/msg00951.html. 
  9. "zsh 1.0 announcement". 15 April 2021. https://github.com/llua/zsh-1.0. 
  10. "Native Win32 ports of some GNU utilities". http://unxutils.sourceforge.net/. 
  11. Warren, Tom (June 4, 2019). "Apple replaces bash with zsh as the default shell in macOS Catalina". https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-features. 
  12. "Use zsh as the default shell on your Mac - Apple Support". https://support.apple.com/en-us/HT208050. 
  13. "Kali Linux 2020.4 Release (ZSH, Bash, CME, MOTD, AWS, Docs, Win-KeX & Vagrant) | Kali Linux Blog" (in English). https://www.kali.org/blog/kali-linux-2020-4-release/. 
  14. "Z-Shell Frequently-Asked Questions". http://zsh.sourceforge.net/FAQ/zshfaq01.html. 
  15. Russel, Robby (23 March 2016). "d'Oh My Zsh". https://www.freecodecamp.org/news/d-oh-my-zsh-af99ca54212c/. 

External links