Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
zsh(1)
Edit
PageHistory
Diff
Info
LikePages
!!NAME zsh - the Z shell !!OVERVIEW Because zsh contains many features, the zsh manual has been split into a number of sections: ;''zsh'' Zsh overview (this section) : ;''zshmisc'' Anything not fitting into the other sections : ;''zshexpn'' Zsh command and parameter expansion : ;''zshparam'' Zsh parameters : ;''zshoptions'' Zsh options : ;''zshbuiltins'' Zsh built-in functions : ;''zshzle'' Zsh command line editing : ;''zshcompwid'' Zsh completion widgets : ;''zshcompsys'' Zsh completion system : ;''zshcompctl'' Zsh completion control : ;''zshmodules'' Zsh loadable modules : ;''zshzftpsys'' Zsh built-in FTP client : ;''zshall'' Meta-man page containing all of the above : !!DESCRIPTION Zsh is a [UNIX] command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most closely resembles __ksh__ but includes many enhancements. Zsh has command line editing, builtin spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features. !!AUTHOR Zsh was originally written by Paul Falstad __<pf__@__zsh.org>__. Zsh is now maintained by the members of the zsh-workers mailing list __<zsh-workers__@__sunsite.dk>__. The development is currently coordinated by Peter Stephenson __<pws__@__zsh.org>__. The coordinator can be contacted at __<coordinator__@__zsh.org>__, but matters relating to the code should generally go to the mailing list. !!AVAILABILITY Zsh is available from the following anonymous FTP sites. These mirror sites are kept frequently up to date. The sites marked with ''(H)'' may be mirroring __ftp.cs.elte.hu__ instead of the primary site. ;Primary site: __ftp://ftp.zsh.org/pub/zsh/__ %%% __http://www.zsh.org/pub/zsh/__ %%% ;Australia : __ftp://ftp.zsh.org/pub/zsh/__ %%% __http://www.zsh.org/pub/zsh/__ %%% ;Denmark : __ftp://sunsite.dk/pub/unix/shells/zsh/__ %%% ;Finland : __ftp://ftp.funet.fi/pub/unix/shells/zsh/__ %%% ;Germany : __ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/__ ''(H)'' %%% __ftp://ftp.gmd.de/packages/zsh/__ %%% __ftp://ftp.uni-trier.de/pub/unix/shell/zsh/__ %%% ;Hungary : __ftp://ftp.cs.elte.hu/pub/zsh/__ %%% __http://www.cs.elte.hu/pub/zsh/__ %%% __ftp://ftp.kfki.hu/pub/packages/zsh/__ %%% ;Israel : __ftp://ftp.math.technion.ac.il/pub/zsh/__ %%% __http://www.math.technion.ac.il/pub/zsh/__ %%% ;Japan : __ftp://ftp.win.ne.jp/pub/shell/zsh/__ %%% __ftp://ftp.ayamura.org/pub/zsh/__ %%% ;Korea : __ftp://linux.sarang.net/mirror/system/shell/zsh/__ %%% ;Netherlands : __ftp://ftp.demon.nl/pub/mirrors/zsh/__ %%% ;Norway : __ftp://ftp.uit.no/pub/unix/shells/zsh/__ %%% ;Poland : __ftp://sunsite.icm.edu.pl/pub/unix/shells/zsh/__ %%% ;Romania : __ftp://ftp.roedu.net/pub/mirrors/ftp.zsh.org/pub/zsh/__ %%% __ftp://ftp.kappa.ro/pub/mirrors/ftp.zsh.org/pub/zsh/__ %%% ;Slovenia : __ftp://ftp.siol.net/mirrors/zsh/__ %%% ;Sweden : __ftp://ftp.lysator.liu.se/pub/unix/zsh/__ %%% ;UK : __ftp://ftp.net.lut.ac.uk/zsh/__ %%% __ftp://sunsite.org.uk/packages/zsh/__ %%% ;USA : __ftp://uiarchive.uiuc.edu/mirrors/ftp/ftp.zsh.org/pub/__ %%% __ftp://ftp.rge.com/pub/shells/zsh/__ %%% __http://zsh.disillusion.org/__ %%% __http://foad.org/zsh/__ %%% The up-to-date source code is available via anonymous CVS from Sourceforge. See __http://sourceforge.net/projects/zsh/__ for details. !!MAILING LISTS Zsh has 3 mailing lists: ;__<zsh-announce__@__sunsite.dk>__: Announcements about releases, major changes in the shell and the monthly posting of the Zsh FAQ. (moderated) ;__<zsh-users__@__sunsite.dk>__ : User discussions. ;__<zsh-workers__@__sunsite.dk>__ : Hacking, development, bug reports and patches. To subscribe or unsubscribe, send mail to the associated administrative address for the mailing list. ;__<zsh-announce-subscribe__@__sunsite.dk>__ : ;__<zsh-users-subscribe__@__sunsite.dk>__ : ;__<zsh-workers-subscribe__@__sunsite.dk>__ : ;__<zsh-announce-unsubscribe__@__sunsite.dk>__ : ;__<zsh-users-unsubscribe__@__sunsite.dk>__ : ;__<zsh-workers-unsubscribe__@__sunsite.dk>__ : YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED. All submissions to __zsh-announce__ are automatically forwarded to __zsh-users__. All submissions to __zsh-users__ are automatically forwarded to __zsh-workers__. If you have problems subscribing/unsubscribing to any of the mailing lists, send mail to __<listmaster__@__zsh.org>__. The mailing lists are maintained by Karsten Thygesen __<karthy__@__kom.auc.dk>__. The mailing lists are archived; the archives can be accessed via the administrative addresses listed above. There is also a hypertext archive, maintained by Geoff Wing __<gcw__@__zsh.org>__, available at __http://www.zsh.org/mla/__. !!THE ZSH FAQ Zsh has a list of Frequently Asked Questions (FAQ), maintained by Peter Stephenson __<pws__@__zsh.org>__. It is regularly posted to the newsgroup __comp.unix.shell__ and the __zsh-announce__ mailing list. The latest version can be found at any of the Zsh FTP sites, or at __http://www.zsh.org/FAQ/__. The contact address for FAQ-related matters is __<faqmaster__@__zsh.org>__. !!THE ZSH WEB PAGE Zsh has a web page which is located at __http://www.zsh.org/__. This is maintained by Karsten Thygesen __<karthy__@__zsh.org>__, of SunSITE Denmark. The contact address for web-related matters is __<webmaster__@__zsh.org>__. !!THE ZSH USERGUIDE A userguide is currently in preparation. It is intended to complement the manual, with explanations and hints on issues where the manual can be cabbalistic, hierographic, or downright mystifying (for example, the word `hierographic' does not exist). It can be viewed in its current state at __http://zsh.sunsite.dk/Guide/__. At the time of writing, chapters dealing with startup files and their contents and the new completion system were essentially complete. !!THE ZSH WIKI A `wiki' website for zsh has been created at __http://www.zshwiki.org/__. This is a site which can be added to and modified directly by users without any special permission. You can add your own zsh tips and configurations. !!INVOCATION OPTIONS The following flags are interpreted by the shell when invoked to determine where the shell will read commands from: ;__-c__: Take the first argument as a command to execute, rather than reading commands from a script or standard input. If any further arguments are given, the first one is assigned to __$0__, rather than being used as a positional parameter. ;__-i__ : Force shell to be interactive. ;__-s__ : Force shell to read commands from the standard input. If the __-s__ flag is not present and an argument is given, the first argument is taken to be the pathname of a script to execute. After the first one or two arguments have been appropriated as described above, the remaining arguments are assigned to the positional parameters. For further options, which are common to invocation and the __set__ builtin, see ''zshoptions''(1). Options may be specified by name using the __-o__ option. __-o__ acts like a single-letter option, but takes a following string as the option name. For example, __zsh -x -o shwordsplit scr__ %%% runs the script __scr__, setting the __XTRACE__ option by the corresponding letter `__-x__' and the __SH_WORD_SPLIT__ option by name. Options may be turned ''off'' by name by using __+o__ instead of __-o__. __-o__ can be stacked up with preceding single-letter options, so for example `__-xo shwordsplit__' or `__-xoshwordsplit__' is equivalent to `__-x -o shwordsplit__'. Options may also be specified by name in GNU long option style, `__- __''option-name'''. When this is done, `__-__' characters in the option name are permitted: they are translated into `_____', and thus ignored. So, for example, `__zsh - sh-word-split__' invokes zsh with the __SH_WORD_SPLIT__ option turned on. Like other option syntaxes, options can be turned off by replacing the initial `__-__' with a `__+__'; thus `__+-sh-word-split__' is equivalent to `__- no-sh-word-split__'. Unlike other option syntaxes, GNU-style long options cannot be stacked with any other options, so for example `__-x-shwordsplit__' is an error, rather than being treated like `__-x - shwordsplit__'. The special GNU-style option `__- version__' is handled; it sends to standard output the shell's version information, then exits successfully. `__- help__' is also handled; it sends to standard output a list of options that can be used when invoking the shell, then exits successfully. Option processing may be finished, allowing following arguments that start with `__-__' or `__+__' to be treated as normal arguments, in two ways. Firstly, a lone `__-__' (or `__+__') as an argument by itself ends option processing. Secondly, a special option `__- __' (or `__+-__'), which may be specified on its own (which is the standard POSIX usage) or may be stacked with preceding options (so `__-x-__' is equivalent to `__-x - __'). Options are not permitted to be stacked after `__- __' (so `__-x-f__' is an error), but note the GNU-style option form discussed above, where `__- shwordsplit__' is permitted and does not end option processing. Except when the __sh__/__ksh__ emulation single-letter options are in effect, the option `__-b__' (or `__+b__') ends option processing. `__-b__' is like `__- __', except that further single-letter options can be stacked after the `__-b__' and will take effect as normal. !!COMPATIBILITY Zsh tries to emulate __sh__ or __ksh__ when it is invoked as __sh__ or __ksh__ respectively; more precisely, it looks at the first letter of the name by which it was invoked, excluding any initial `__r__' (assumed to stand for `restricted'), and if that is `__s__' or `__k__' it will emulate __sh__ or __ksh__. Furthermore, if invoked as __su__ (which happens on certain systems when the shell is executed by the __su__ command), the shell will try to find an alternative name from the __SHELL__ environment variable and perform emulation based on that. In __sh__ and __ksh__ compatibility modes the following parameters are not special and not initialized by the shell: __ARGC__, __argv__, __cdpath__, __fignore__, __fpath__, __HISTCHARS__, __mailpath__, __MANPATH__, __manpath__, __path__, __prompt__, __PROMPT__, __PROMPT2__, __PROMPT3__, __PROMPT4__, __psvar__, __status__, __watch__. The usual zsh startup/shutdown scripts are not executed. Login shells source __/etc/profile__ followed by __$HOME/.profile__. If the __ENV__ environment variable is set on invocation, __$ENV__ is sourced after the profile scripts. The value of __ENV__ is subjected to parameter expansion, command substitution, and arithmetic expansion before being interpreted as a pathname. Note that the __PRIVILEGED__ option also affects the execution of startup files. The following options are set if the shell is invoked as __sh__ or __ksh__: __NO_BAD_PATTERN__, __NO_BANG_HIST__, __NO_BG_NICE__, __NO_EQUALS__, __NO_FUNCTION_ARGZERO__, __GLOB_SUBST__, __NO_GLOBAL_EXPORT__, __NO_HUP__, __INTERACTIVE_COMMENTS__, __KSH_ARRAYS__, __NO_MULTIOS__, __NO_NOMATCH__, __NO_NOTIFY__, __POSIX_BUILTINS__, __NO_PROMPT_PERCENT__, __RM_STAR_SILENT__, __SH_FILE_EXPANSION__, __SH_GLOB__, __SH_OPTION_LETTERS__, __SH_WORD_SPLIT__. Additionally the __BSD_ECHO__ and __IGNORE_BRACES__ options are set if zsh is invoked as __sh__. Also, the __KSH_OPTION_PRINT__, __LOCAL_OPTIONS__, __PROMPT_BANG__, __PROMPT_SUBST__ and __SINGLE_LINE_ZLE__ options are set if zsh is invoked as __ksh__. !!RESTRICTED SHELL When the basename of the command used to invoke zsh starts with the letter `__r__' or the `__-r__' command line option is supplied at invocation, the shell becomes restricted. Emulation mode is determined after stripping the letter `__r__' from the invocation name. The following are disabled in restricted mode: * changing directories with the __cd__ builtin * changing or unsetting the __PATH__, __path__, __MODULE_PATH__, __module_path__, __SHELL__, __HISTFILE__, __HISTSIZE__, __GID__, __EGID__, __UID__, __EUID__, __USERNAME__, __LD_LIBRARY_PATH__, __LD_AOUT_LIBRARY_PATH__, __LD_PRELOAD__ and __LD_AOUT_PRELOAD__ parameters * specifying command names containing __/__ * specifying command pathnames using __hash__ * redirecting output to files * using the __exec__ builtin command to replace the shell with another command * using __jobs -Z__ to overwrite the shell process' argument and environment space * using the __ARGV0__ parameter to override __argv[[0]__ for external commands * turning off restricted mode with __set +r__ or __unsetopt RESTRICTED These restrictions are enforced after processing the startup files. The startup files should set up __PATH__ to point to a directory of commands which can be safely invoked in the restricted environment. They may also add further restrictions by disabling selected builtins. Restricted mode can also be activated any time by setting the __RESTRICTED__ option. This immediately enables all the restrictions described above even if the shell still has not processed all startup files. !!STARTUP/SHUTDOWN FILES Commands are first read from __/etc/zshenv__; this cannot be overridden. Subsequent behaviour is modified by the __RCS__ and __GLOBAL_RCS__ options; the former affects all startup files, while the second only affects those in the __/etc__ directory. If one of the options is unset at any point, any subsequent startup file(s) of the corresponding type will not be read. It is also possible for a file in __$ZDOTDIR__ to re-enable __GLOBAL_RCS__. Both __RCS__ and __GLOBAL_RCS__ are set by default. Commands are then read from __$ZDOTDIR/.zshenv__. If the shell is a login shell, commands are read from __/etc/zprofile__ and then __$ZDOTDIR/.zprofile__. Then, if the shell is interactive, commands are read from __/etc/zshrc__ and then __$ZDOTDIR/.zshrc__. Finally, if the shell is a login shell, __/etc/zlogin__ and __$ZDOTDIR/.zlogin__ are read. When a login shell exits, the files __$ZDOTDIR/.zlogout__ and then __/etc/zlogout__ are read. This happens with either an explicit exit via the __exit__ or __logout__ commands, or an implicit exit by reading end-of-file from the terminal. However, if the shell terminates due to __exec__'ing another process, the logout files are not read. These are also affected by the __RCS__ and __GLOBAL_RCS__ options. Note also that the __RCS__ option affects the saving of history files, i.e. if __RCS__ is unset when the shell exits, no history file will be saved. If __ZDOTDIR__ is unset, __HOME__ is used instead. Those files listed above as being in __/etc__ may be in another directory, depending on the installation. As __/etc/zshenv__ is run for all instances of zsh, it is important that it be kept as small as possible. In particular, it is a good idea to put code that does not need to be run for every single shell behind a test of the form `__if [[[[ -o rcs ]]; then ...__' so that it will not be executed when zsh is invoked with the `__-f__' option. Any of these files may be pre-compiled with the __zcompile__ builtin command (see ''zshbuiltins''(1)). If a compiled file exists (named for the original file plus the __.zwc__ extension) and it is newer than the original file, the compiled file will be used instead. !!FILES ;__$ZDOTDIR/.zshenv__ : ;__$ZDOTDIR/.zprofile__ : ;__$ZDOTDIR/.zshrc__ : ;__$ZDOTDIR/.zlogin__ : ;__$ZDOTDIR/.zlogout__ : ;__${TMPPREFIX}*__ (default is /tmp/zsh*) : ;__/etc/zshenv__ : ;__/etc/zprofile__ : ;__/etc/zshrc__ : ;__/etc/zlogin__ : ;__/etc/zlogout__ (installation-specific - __/etc__ is the default) : !!SEE ALSO ''sh(1)'', ''csh(1)'', ''tcsh(1)'', ''!rc(1)'', ''bash(1)'', ''!ksh(1)'', ''!zshbuiltins(1)'', ''!zshcompwid(1)'', ''!zshcompsys(1)'', ''!zshcompctl(1)'', ''!zshexpn(1)'', ''!zshmisc(1)'', ''!zshmodules(1)'', ''!zshoptions(1)'', ''!zshparam(1)'', ''!zshzle(1)'' [IEEE] Standard for information Technology - Portable Operating System Interface ([POSIX]) - Part 2: Shell and Utilities, IEEE Inc, 1993, ISBN 1-55937-255-9.
5 pages link to
zsh(1)
:
CommonErrors
Shell
SIGWINCH
BashNotes
UnicodeNotes
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.