Z shell

維基百科,自由的百科全書
跳至導覽 跳至搜尋
Z shell
File:Z Shell Logo Color Horizontal.svg
Zsh會話截圖
Zsh會話截圖
原作者Paul Falstad[1]
開發者Peter Stephenson, et al.[1]
首次發布1990年,​36年前​(1990
當前版本
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    源代碼庫
    • {{URL|example.com|可选的显示文本}}
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    編程語言C
    引擎
      Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
      操作系統跨平臺
      類型Unix shell
      許可協議MIT-like[2]

      Z shellZsh)是一款可用作交互式英語interactive登錄的shell腳本編寫命令解釋器。Zsh對Bourne shell做出了大量改進,同時加入了Bashkshtcsh的某些功能。

      2019年時,在MacOS上由於Bash的版本已經很舊(v3.2.57),而新版本的Bash v5改採GPLv3授權,這是Apple公司無法接受的。於是自當時起,macOS的預設Shell已從Bash改為Zsh。

      Kali Linux也使用zsh作為默認shell。

      起源[編輯]

      保羅·弗斯塔德(Paul Falstad)於1990年在普林斯頓大學求學時編寫了Zsh的初版[3][4]名稱zsh源於耶魯大學教授邵中(Zhong Shao,後轉為普林斯頓大學教授) — 保羅將教授的用戶名"zsh"作為此Shell的名稱。[5][6]

      特性[編輯]

      File:Zsh-new-user.png
      Z shell向新用戶提供的配置工具

      特性包括:

      • 可幫助用戶鍵入常用命令選項及參數的可編程命令行補全功能英語command-line completion,自帶對數百條命令的支持
      • 可與任意Shell共享命令行歷史記錄
      • 可在無需運行外部程序(如find)的情況下通過文件擴展英語glob (programming)匹配文件
      • 改進變量/數組處理方式
      • 在單緩衝區內編輯多行命令
      • 拼寫檢查
      • 多種兼容模式(例如,Zsh可在運行為/bin/sh的情況下偽裝成Bourne shell
      • 可編程的命令行界面,包括將提示行信息顯示在屏幕右側並在輸入過長指令時自動隱藏的功能
      • 可加載模塊可提供額外支持:完整傳輸控制協議Unix域套接字控制、FTP客戶端及擴展數學函數。
      • 自帶where命令,其與which命令類似,但是顯示指定於$PATH中所指定指令的全部位置,而不是僅顯示所使用指令的位置。
      • 目錄名稱。此功能可讓用戶設定快捷方式,(如~mydir,與~~user的工作方式相似)。

      Oh My Zsh[編輯]

      File:Zsh-agnoster.png
      運行於Konsole終端模擬器上使用Agnoster主題的Zsh

      用戶社區網站"Oh My Zsh"收集Z shell的第三方插件及主題。[7]截止於2018年,其GitHub源共有超過1000位貢獻者、200多款插件和超過140款主題。同時也帶有更新已安裝插件及主題的自動更新工具。[8]

      另請參閱[編輯]

      參考文獻[編輯]

      1. ^ 1.0 1.1 The Z Shell Manual (Version 5.0.0). Sourceforge.net. July 21, 2012 [September 18, 2012]. (原始內容存檔於2018-02-20). 
      2. ^ zsh / Code / [281031] /LICENCE. Paul Falstad. [February 7, 2015]. (原始內容存檔於2021-03-02). 
      3. ^ zsh - a ksh/tcsh-like shell (part 1 of 8). alt.sources. December 14, 1990 [September 18, 2012]. 
      4. ^ Z-Shell Frequently-Asked Questions. Sourceforge.net. February 15, 2010 [September 18, 2012]. (原始內容存檔於2021-03-02). 
      5. ^ The Z-Shell (ZSH) Lovers' Page. Guckes.net. c. 2004 [October 2, 2012]. (原始內容存檔於2017-05-17). 
      6. ^ Zsh Mailing List Archive. Zsh.org. August 8, 2005 [October 2, 2012]. (原始內容存檔於2021-03-02). 
      7. ^ Oh My ZSH - Community driven framework with 150+ plugins and 100+ themes. [May 7, 2014]. (原始內容存檔於2022-03-20). 
      8. ^ robbyrussell/oh-my-zsh. [2018-10-17]. (原始內容存檔於2021-03-02). A delightful community-driven (with 1,000+ contributors) framework for managing your zsh configuration. Includes 200+ optional plugins (rails, git, OSX, hub, capistrano, brew, ant, php, python, etc), over 140 themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community. 

      外部連結[編輯]

      官方[編輯]

      文章[編輯]

      其他[編輯]