ZSHMODULES(1) General Commands Manual ZSHMODULES(1) (NAME) zshmodules - (zsh) (DESCRIPTION) zsh . . zmodload zshbuiltins(1) . zsh : zsh/attr (xattr). zsh/cap () POSIX.1e (POSIX.6). zsh/clone . zsh/compctl compctl . zsh/complete . zsh/complist . zsh/computil . zsh/curses curses zsh/datetime . zsh/db/gdbm GDBM. zsh/deltochar ZLE zap-to-char EMACS . zsh/example . zsh/files . zsh/langinfo (locale). zsh/mapfile . zsh/mathfunc . zsh/nearcolor . zsh/newuser . zsh/parameter . zsh/pcre PCRE. zsh/param/private . zsh/regex POSIX. zsh/sched . zsh/net/socket zsh/stat stat. zsh/system . zsh/net/tcp TCP zsh/termcap termcap. zsh/terminfo terminfo. zsh/watch . zsh/zftp FTP. zsh/zle Zsh bindkey vared. zsh/zleparameter Zsh . zsh/zprof . zsh/zpty . zsh/zselect . zsh/zutil (styles). ZSH/ATTR (THE ZSH/ATTR MODULE) zsh/attr . -h . : zgetattr [ -h ] filename attribute [ parameter ] attribute filename . parameter . zsetattr [ -h ] filename attribute value attribute filename value . zdelattr [ -h ] filename attribute attribute filename . zlistattr [ -h ] filename [ parameter ] filename . parameter . zgetattr zlistattr . 2 . 1 . . ZSH/CAP (THE ZSH/CAP MODULE) zsh/cap POSIX.1e (POSIX.6) . . : cap [ capabilities ] capabilities . getcap filename ... () POSIX . filename . setcap capabilities filename ... POSIX . filename capabilities . ZSH/CLONE (THE ZSH/CLONE MODULE) zsh/clone : clone tty (forked) tty . PID PPID TTY . $! PID . . clone : xterm -e sh -c 'trap : INT QUIT TSTP; tty; while :; do sleep 100000000; done' xterm : (<<>> SID) . zsh tty . : o (job control) sh-started-by-xterm ( INT QUIT TSTP trap while ) o ( control-C control-\ control-Z) . vc . ( ) . clone openvt . ZSH/COMPCTL (THE ZSH/COMPCTL MODULE) zsh/compctl . compctl ZLE . zshcompctl(1) . compcall zshcompwid(1) . ZSH/COMPLETE (THE ZSH/COMPLETE MODULE) zsh/complete zshcompwid(1) . ZSH/COMPLIST (THE ZSH/COMPLIST MODULE) zsh/complist : () . (Colored completion listings) ZLS_COLORS ZLS_COLOURS zsh/complist . complist : `zmodload zsh/complist' . ZLS_COLORS ZLS_COLOURS . . GNU ls : (:) `name=value'. name value . : no 0 ( ) fi 0 (regular files) di 32 ln 36 (symbolic links). target . pi 31 (FIFOs) so 33 bd 44;37 (block devices) cd 44;37 (character devices) or none ( ln ) mi none ( fi ) su 37;41 setuid sg 30;43 setgid tw 30;42 (sticky bit) ow 34;43 sa none (suffix alias) st 37;44 ex 35 lc \e[ ( ) rc m tc 0 LIST_TYPES sp 0 ec none name (`*') . value . name (`=') EXTENDED_GLOB . value ( ) . ( ) . . `(#b)' . value . . `=(#b)(?)*(?)=0=3=7' `3' `7' `0' . name . value . `(g*)m*=43' `m' `g' `43' . `lc' `rc' `ec' . . ( ) . (backreferences) . lc `*' rc ec ( ) lc no rc ( ec ) . ISO 6429 (ANSI) vt100 xterm . . colors (contribution) ANSI ( `Other Functions' zshcontrib(1) ). colors `$color[red]' `$color[bg-green]' . compinit . list-colors ( `Completion System Configuration' zshcompsys(1) ). (Scrolling in completion listings) () LISTPROMPT . (prompt) . `%x' . `%B' `%b' `%S' `%s' `%U' `%u' `%F' `%f' `%K' `%k' `%{...%}' : `%l' `%L' `number/total' `%m' `%M' `%p' `%P' `Top' `Bottom' . . LISTPROMPT . listscroll . zle : send-break accept-line, down-history, down-line-or-history down-line-or-search, vi-down-line-or-history complete-word, menu-complete, expand-or-complete expand-or-complete-prefix, menu-complete-or-expand accept-search . listscroll undefined-key . ZLS_COLORS ZLS_COLOURS LISTPROMPT . list-prompt . (Menu selection) zsh/complist (menu selection) ( ALWAYS_LAST_PROMPT zshoptions(1) ). menu-select . ZLE zshzle(1) . MENUSELECT . menu-complete MENU_COMPLETE AUTO_MENU. MENUSELECT 0 1 . MENUSELECT ( ZLS_COLORS ZLS_COLOURS ). menu select=... . . . . ma ZLS_COLORS ZLS_COLOURS . `7' (standout mode) vt100 . ZLS_COLORS ZLS_COLOURS `%S' . MENUPROMPT . LISTPROMPT . . MENUSCROLL . `0' () . . ZLS_COLORS ZLS_COLOURS LISTPROMPT MENUPROMPT MENUSCROLL . select-prompt select-scroll . . ( -n compadd) ( ). . hi du ZLS_COLORS ZLS_COLOURS . zle . . zle . : accept-line, accept-search ( ) send-break redisplay, clear-screen accept-and-hold, accept-and-menu-complete accept-and-infer-next-history undo ( zle ) undo down-history, down-line-or-history vi-down-line-or-history, down-line-or-search up-history, up-line-or-history vi-up-line-or-history, up-line-or-search forward-char, vi-forward-char backward-char, vi-backward-char forward-word, vi-forward-word vi-forward-word-end, emacs-forward-word backward-word, vi-backward-word, emacs-backward-word vi-forward-blank-word, vi-forward-blank-word-end vi-backward-blank-word beginning-of-history end-of-history beginning-of-buffer-or-history, beginning-of-line beginning-of-line-hist, vi-beginning-of-line end-of-buffer-or-history, end-of-line end-of-line-hist, vi-end-of-line complete-word, menu-complete, expand-or-complete expand-or-complete-prefix, menu-expand-or-complete reverse-menu-complete vi-insert self-insert self-insert-unmeta undo backward-delete-char history-incremental-search-forward history-incremental-search-backward accept-line (wrap around) zle . `.' . `.accept-line' . menuselect . undefined-key . ( return TAB) . menuselect bindkey ( zshmodules(1) ). return zsh/complist : bindkey -M menuselect '^M' send-break ZSH/COMPUTIL (THE ZSH/COMPUTIL MODULE) zsh/computil ( zshcompsys(1) ). compquote . : comparguments _arguments . compdescribe -i . compdescribe _describe . -i -I . ( ) . _describe . compdescribe -i -I -g . compstate[list] compadd . compadd . compfiles _path_files (globbing) . : -p -P (glob) . -i ignore-parents -r . compgroups _tags group-order . ( : ). compquote [ -p ] names ... -Q compadd () . all_quotes compstate q . . -p . . comptags comptry (tags) . compvalues comparguments _values. ZSH/CURSES (THE ZSH/CURSES MODULE) zsh/curses . (Builtin) zcurses init zcurses end zcurses addwin targetwin nlines ncols begin_y begin_x [ parentwin ] zcurses delwin targetwin zcurses refresh [ targetwin ... ] zcurses touch targetwin ... zcurses move targetwin new_y new_x zcurses clear targetwin [ redraw | eol | bot ] zcurses position targetwin array zcurses char targetwin character zcurses string targetwin string zcurses border targetwin border zcurses attr targetwin [ [+|-]attribute | fg_col/bg_col ] [...] zcurses bg targetwin [ [+|-]attribute | fg_col/bg_col | @char ] [...] zcurses scroll targetwin [ on | off | [+|-]lines ] zcurses input targetwin [ param [ kparam [ mparam ] ] ] zcurses mouse [ delay num | [+|-]motion ] zcurses timeout targetwin intval zcurses querychar targetwin [ param ] zcurses resize height width [ endwin | nosave | endwin_nosave ] curses. `zcurses init' curses `zcurses end' `zcurses end' . addwin nlines ncols . begin_y begin_x . targetwin . curses . addwin parentwin . . . . delwin addwin . end delwin . stdscr `zcurses init' delwin . refresh targetwin ( char ) . refresh . . touch targetwin . refresh ( stdscr ) . move targetwin new_y new_x . string ( char) . clear targetwin . ( ) : redraw refresh targetwin . eol targetwin . bot targetwin . position targetwin array . : - y x targetwin - y x targetwin - targetwin y x. char string . targetwin border . : . attr targetwin / . attribute + - + . blink bold dim reverse standout underline. fg_col/bg_col ( << >>) . default ( ncurses ) . default/default . 8 ( ...) fg_col/bg_col fg_col bg_col 128/200. . bg . . attr @char . curses ( ASCII ). . scroll on off . ( ). off on . input . param param REPLY . param kparam <> . (F-keys) kparam . curses.h ncurses.h `KEY_' zcurses_keycodes . param . param kparam . mparam input . ncurses `zcurses mouse' . ( ) kparam MOUSE mparam : - . - x y z ( y x ). z . - . PRESSED RELEASED CLICKED DOUBLE_CLICKED TRIPLE_CLICKED ( ) . - shift SHIFT. - control CTRL. - alt ALT. . ncurses . mouse . . `zcurses mouse' 0 1 . ( ) : delay num 0 . motion `+' () `-' ( ) . . timeout (timeout) targetwin . intval `zcurses input' . intval `zcurses input' 1 . intval `zcurses input' intval 1 . querychar . param reply . ( ) fg_col/bg_col 0 . ( attr ) . resize stdscr ( ). curses ( resize_term) . height width . 0 resize_term ( 2). zcurses end zcurses refresh . resize . zcurses end zcurses refresh . resize endwin . nosave zcurses . . (Parameters) ZCURSES_COLORS . . curses zcurses init . ZCURSES_COLOR_PAIRS . fg_col/bg_col `zcurses attr' . curses zcurses init . zcurses_attrs . zsh/curses . zcurses_colors . zsh/curses . zcurses_keycodes . `zcurses input' curses . F0 curses F0 F63 . zcurses_windows . `zcurses addwin' `zcurses delwin' . ZSH/DATETIME (THE ZSH/DATETIME MODULE) zsh/datetime : strftime [ -s scalar | -n ] format [ epochtime [ nanoseconds ] ] strftime -r [ -q ] [ -s scalar | -n ] format timestring format . epochtime / epochtime (epoch) nanoseconds ( 0 ). strftime(3) . zsh EXPANSION OF PROMPT SEQUENCES zshmisc(1) . -n . -q . epochtime . -r -r () format timestring . strptime strptime(3) . zsh . strftime timestring TZ . timestring format 1 . timestring format timestring . strptime mktime 2 . -s scalar ( -r) scalar . strftime 2147483647 ( 2038-01-19 03:14:07 +0000 ) . zsh/datetime : EPOCHREALTIME . clock_gettime . EPOCHSECONDS . epochtime . . : for secs nsecs in $epochtime; do ... done ZSH/DB/GDBM (THE ZSH/DB/GDBM MODULE) zsh/db/gdbm <<>> (tied) . GDBM . ztie . : ztie -d db/gdbm -f filename [ -r ] arrayname GDBM filename arrayname . : local -A sampledb ztie -d db/gdbm -f sample.gdbm sampledb -r . `ztie' . arrayname filename . filename arrayname `typeset -r arrayname' . zuntie [ -u ] arrayname ... GDBM arrayname (unset) . -u `ztie -r' . () . `ztie -r' `zuntie -u' . zgdbmpath parametername parametername REPLY . zgdbm_tied (tied). GDBM . . ZSH/DELTOCHAR (THE ZSH/DELTOCHAR MODULE) zsh/deltochar ZLE : delete-to-char ( n n) ( ) . . zap-to-char delete-to-char . ZSH/EXAMPLE (THE ZSH/EXAMPLE MODULE) zsh/example : example [ -flags ] [ args ... ] . . ZSH/FILES (THE ZSH/FILES MODULE) zsh/files . . zf_ . zmodload . zsh : zmodload -m -F zsh/files b:zf_\* : chgrp [ -hRs ] group filename ... . chown user-spec `:group' . chmod [ -Rs ] mode filename ... . mode () . -R chmod . -s zsh chmod . (paranoid) chmod . ``chmod 600 /tmp/foo/passwd'' /etc/passwd /tmp/foo /etc . chmod /usr . chown [ -hRs ] user-spec filename ... . user-spec : user user user:: user user: user user user:group user group :group group `:' `.' . `:' `:' `.' `.' . user group ( ) ( ) . ( ) . -h chown . -R chown . -s zsh chown . chown . ``chown luser /tmp/foo/passwd'' /etc/passwd /tmp/foo /etc . /usr . ln [ -dfhins ] filename dest ln [ -dfhins ] filename ... dir ( -s ) . dest filename . filename dir . ln . -d . () . . . -i . -f . -f . -h -n . -sf . . mkdir [ -p ] [ -m mode ] dir ... . -p . -m ( ) 777 umask ( umask(2) ). mv [ -fi ] filename dest mv [ -fi ] filename ... dir . filename dest . filename dir . . -i . -f . -f . mv ( ) . mv cp rm . . rm [ -dfiRrs ] filename ... . rm ( -R -r). -d rm unlink ( unlink(2) ) . . -d -R -r . . -i . -f . -f . -R -r rm rmdir ( rmdir(2) ). -s zsh rm . rm . ``rm /tmp/foo/passwd'' /etc/passwd /tmp/foo /etc . /usr . rmdir dir ... . sync ( sync(2) ) (dirty) . / . ZSH/LANGINFO (THE ZSH/LANGINFO MODULE) zsh/langinfo : langinfo langinfo . : CODESET, D_T_FMT, D_FMT, T_FMT, RADIXCHAR, THOUSEP, YESEXPR, NOEXPR, CRNCYSTR, ABDAY_{1..7}, DAY_{1..7}, ABMON_{1..12}, MON_{1..12}, T_FMT_AMPM, AM_STR, PM_STR, ERA, ERA_D_FMT, ERA_D_T_FMT, ERA_T_FMT, ALT_DIGITS ZSH/MAPFILE (THE ZSH/MAPFILE MODULE) zsh/mapfile . mapfile . . ( ) (unset) . `vared 'mapfile[myfile]'' `myfile' . ( ). ${(k)mapfile} *(D) . rm ${(k)mapfile} `rm *' . mapfile . `array=("${(f@)mapfile[filename]}")' . `@' . `array=("${(f@)${mapfile[filename]%$'\n'}}")' . (Limitations) zsh mapfile . ( ). ( swap ) . . . ZSH/MATHFUNC (THE ZSH/MATHFUNC MODULE) zsh/mathfunc . C FORTRAN : (( f = sin(0.3) )) 0.3 f . . . atan abs int float C . : acos acosh asin asinh atan atanh cbrt ceil cos cosh erf erfc exp expm1 fabs floor gamma j0 j1 lgamma log log10 log1p log2 logb sin sinh sqrt tan tanh y0 y1. atan C atan2 . ilogb . signgam C gamma(3) . gamma lgamma . `signgam()' `signgam' . min max sum zmathfunc `Mathematical Functions' zshcontrib(1) . : copysign fmod hypot nextafter. : jn yn. : ldexp scalb. abs . float int ( ) . pow C `**' . rand48 erand48(3) . 0 1 . . (seed) rand(3) --- $RANDOM . . ( ) rand48 . rand48(param) param . rand48 . : print $(( rand48(seed) )) print $(( rand48() )) print $(( rand48(seed) )) $seed . rand() . rand48() . ZSH/NEARCOLOR (THE ZSH/NEARCOLOR MODULE) zsh/nearcolor . (true colour) . . . ANSI . (bright) . . . zsh/nearcolor . . . (true colour) . zsh/nearcolor . COLORTERM : [[ $COLORTERM = *(24bit|truecolor)* ]] || zmodload zsh/nearcolor true color zsh/nearcolor. ZSH/NEWUSER (THE ZSH/NEWUSER MODULE) zsh/newuser RCS PRIVILEGED ( ) . zshenv ( /etc/zsh/zshenv) . $MODULE_PATH . .zshenv .zprofile .zshrc .zlogin ZDOTDIR . ( zsh ) . newuser ( site-functions) ( functions ) . ( zsh --enable-site-scriptdir=dir --enable-scriptdir=dir configure prefix/share/zsh prefix/share/zsh/$ZSH_VERSION prefix /usr/local .) newuser (source) . . zsh/newuser (unload) . /etc/zsh/zshenv zsh/newuser . . zsh-newuser-install . zsh/newuser . . `User Configuration Functions' zshcontrib(1) . ZSH/PARAMETER (THE ZSH/PARAMETER MODULE) zsh/parameter (hash tables) . options setopt unsetopt . on off . . (unset) off . commands . . hash. `unset "commands[foo]"' . functions . . . dis_functions functions . functions_source . (autoloaded) `functions -r' . . . autoload . : $functions . dis_functions_source functions_source . builtins . `undefined' `defined' . dis_builtins builtins . reswords . dis_reswords reswords . patchars (pattern characters) . dis_patchars patchars . aliases (alias) . dis_aliases aliases . galiases aliases (global aliases). dis_galiases galiases . saliases raliases (suffix aliases). dis_saliases saliases . parameters . t zshexpn(1) . . modules . . `loaded' `autoloaded' `alias:name' name . . dirstack (directory stack). dirs . history . (${history[@]}) . historywords . . jobdirs (jobs) ( ). ${(k)jobdirs} . ${jobdirs[%+]} . jobs . jobtexts . jobdirs . jobs . jobstates . `job-state:mark:pid=state...' . job-state `running' `suspended' `done' . mark `+' `-' . `:pid=state' . pid state . jobdirs . jobs . nameddirs . userdirs . usergroups . id . funcfiletrace ( EVAL_LINENO ) eval . funcsourcetrace functrace funcsourcetrace functrace . funcsourcetrace ( EVAL_LINENO) eval . `function name' `name ()' . autoload . filename:lineno . zsh source `.' filename:0 . . funcfiletrace . funcstack ( EVAL_LINENO) eval . . zsh_eval_context : toplevel $funcstack . functrace . name:lineno . source `.' . ZSH/PCRE (THE ZSH/PCRE MODULE) zsh/pcre : pcre_compile [ -aimxs ] PCRE (PCRE) . -a (anchored) . -i (case-insensitive). -m ^ $ . -x # . -s . pcre_study PCRE . pcre_match [ -v var ] [ -a arr ] [ -n offset ] [ -b ] string string PCRE . pcre_match match -a arr . MATCH -v var . . -n offset string . -b ZPCRE_OP string . ZPCRE_OP "32 45" 32 44 . 45 . UTF-8 . string -n . << >> . << >>: string="The following zip codes: 78884 90210 99513" pcre_compile -m "\d{5}" accum=() pcre_match -b -- $string while [[ $? -eq 0 ]] do b=($=ZPCRE_OP) accum+=$MATCH pcre_match -b -n $b[2] -- $string done print -l $accum zsh/pcre : expr -pcre-match pcre . : [[ "$text" -pcre-match ^d+$ ]] && print text variable contains only "d's". REMATCH_PCRE =~ -pcre-match NO_CASE_MATCH . NO_CASE_MATCH pcre_match -i pcre_compile . ZSH/PARAM/PRIVATE (THE ZSH/PARAM/PRIVATE MODULE) zsh/param/private (scope) . autoload : private [ {+|-}AHUahlmrtux ] [ {+|-}EFLRZi [ n ] ] [ name[=value] ... ] private local (zshbuiltins(1)) `-T'. (tied) . `-p' (no-op) . `typeset -p' . ( ) private declare typeset. WARN_CREATE_GLOBAL (zshoptions(1)) . private local . ARGC argv COLUMNS LINES UID EUID IFS PROMPT RANDOM SECONDS `-h' . . typeset private name=(value...) . `private' zsh/param/private private . `-P' `local' . zsh/param/private `bad_declaration' : bad_declaration() { zmodload zsh/param/private private array=( one two three ) } local : good_declaration() { zmodload zsh/param/private local -P array=( one two three ) } autoload : zmodload zsh/param/private iffy_declaration() { private array=( one two three ) } private . private : o local . o . . o . . . o (exported) . . (static scope) C . `typeset -S' ksh . ZSH/REGEX (THE ZSH/REGEX MODULE) zsh/regex : expr -regex-match regex POSIX . MATCH . match . . : [[ alphabetical -regex-match ^a([^a]+)a([^a]+)a ]] && print -l $MATCH X $match REMATCH_PCRE =~ -regex-match . BASH_REMATCH BASH_REMATCH MATCH match . zsh/regex . regex expr regex . POSIX . GNU libc BSD libc ( \b [[:<:]]/[[:>:]]) . regcomp(3) re_format(7) . ZSH/SCHED (THE ZSH/SCHED MODULE) zsh/sched . sched [-o] [+]hh:mm[:ss] command ... sched [-o] [+]seconds command ... sched [ -item ] . () . (1970/01/01 00:00) zsh/datetime zsh/datetime zshmodules(1) . . -o . `-item' . . . . -o . . `zle' `zle widget' widget . sched . `zmodload -F zsh/sched b:sched' . zsh_scheduled_events sched. sched ( KSH_ARRAYS ). ( `The zsh/datetime Module' ) ( `-' ) . sched . . ZSH/NET/SOCKET (THE ZSH/NET/SOCKET MODULE) zsh/net/socket : zsocket [ -altv ] [ -d fd ] [ args ] zsocket / . (Outbound Connections) zsocket [ -v ] [ -d fd ] filename filename . REPLY . (stream connections) . -d . -v . : exec {REPLY}>&- (Inbound Connections) zsocket -l [ -v ] [ -d fd ] filename zsocket -l filename . REPLY . . -d . -v . zsocket -a [ -tv ] [ -d targetfd ] listenfd zsocket -a listenfd . REPLY . . -d . -t zsocket . . -v . ZSH/STAT (THE ZSH/STAT MODULE) zsh/stat : zstat [ -gnNolLtTrs ] [ -f fd ] [ -H hash ] [ -A array ] [ -F fmt ] [ +element ] [ file ... ] stat ... stat ( stat(2) ). stat zstat . `zmodload -F zsh/stat b:zstat' . stat 1 . struct stat . stat `link' . : device . inode ( `inode'). mode . -s ls -l . nlink . uid . -s . gid . -s . rdev . . size . atime mtime ctime (GMT). -s -F -g GMT . blksize . block . link -L . (``zstat +link'') -L . `+' . . . : -A array array struct stat . array -t -n . -t -n . . -H hash -A ( ) hash . . -n name . -f fd fd . -F fmt strftime ( strftime(3) ) . zsh EXPANSION OF PROMPT SEQUENCES zshmisc(1) . -F %s.%N . -s . -g (GMT) . -s . -l ( ) -A . -L stat lstat ( lstat(2) ) . . link . ls(1) . -n . . -N . -o () . . ( -r -s ) . -r ( ) ( -s) . -s mode uid gid . ls -l . -t struct stat . . -T struct stat . ZSH/SYSTEM (THE ZSH/SYSTEM MODULE) zsh/system . (Builtins) syserror [ -e errvar ] [ -p prefix ] [ errno | errname ] errno ( ) . errname ENOENT . errnos . prefix . errvar errvar . 0 ( ) 1 2 ( ). sysopen [ -arw ] [ -m permissions ] [ -o options ] -u fd file . -r -w -a . -m . -u . 0 9 . -o . . : cloexec ( ) create creat excl noatime (atime) nofollow file nonblock (nonblocking) sync truncate trunc 0 (truncate) : exec {fd}<&- exec {fd}>&- sysread [ -c countvar ] [ -i infd ] [ -o outfd ] [ -s bufsize ] [ -t timeout ] [ param ] infd ( ) . param REPLY . countvar countvar . bufsize 8192 . timeout (poll) . poll select . outfd outfd . EINTR zsh param ( ) countvar . countvar param . EINTR ( ) . . : 0 . 1 . . 2 . ERRNO . 3 outfd . ERRNO . 4 . ERRNO . 5 . (EOF) . outfd . sysseek [ -u fd ] [ -w start|end|current ] offset . offset . -u . -w . syswrite [ -c countvar ] [ -o outfd ] data ( ) write outfd ( 1 ) . . countvar countvar data . EINTR ( ) . EAGAIN ( EWOULDBLOCK) . 0 1 2 ERRNO . zsystem flock [ -t timeout ] [ -i interval ] [ -f var ] [-er] file zsystem flock -u fd_expr flock zsystem (advisory file locking fcntl(2)) . . file . . print -u . `(print message) >> file'. 0 1 . fd_expr . `-f var' var . `exec {var}>&-' . . -t timeout . interval ( -i interval) . ( interval timeout ). 2 . (: timeout 2^30-1 ( ) interval 0.999 * LONG_MAX ( ) .) -e exec . -r . . zsystem supports subcommand supports zsystem . 0 1 . ( ) 255 . 1 : subcommand subcommand ( ). (Math Functions) systell(fd) systell . (Parameters) errnos . C errno.h . ( KSH_ARRAYS ) . num Enum . . sysparams . : pid (PID) . $$ . ppid . $PPID . procsubstpid <(...) >(...). ZSH/NET/TCP (THE ZSH/NET/TCP MODULE) zsh/net/tcp : ztcp [ -acflLtv ] [ -d fd ] [ args ] ztcp / . ztcp (session table) . -L . . ( ) : (File descriptor) . (I) (O) . `ztcp -c' . (Connection type) : Z zftp . L (listening) `ztcp -l' . I `ztcp -a' . O `ztcp host ...' . (The local host) IP . (The local port) . (The remote host) (FQDN) IP . IP . (The remote port) . (Outbound Connections) ztcp [ -v ] [ -d fd ] host [ port ] TCP host . port 23 . REPLY . -d . -v . (Inbound Connections) ztcp -l [ -v ] [ -d fd ] port ztcp -l TCP port . REPLY . -d . -v . ztcp -a [ -tv ] [ -d targetfd ] listenfd ztcp -a listenfd . REPLY . -d . -t ztcp . . -v . (Closing Connections) ztcp -cf [ -v ] [ fd ] ztcp -c [ -v ] [ fd ] ztcp -c fd . . fd ztcp . zftp ( zshmodules(1) ) . -f . -v . (Example) TCP zsh . . host1: zmodload zsh/net/tcp ztcp -l 5123 listenfd=$REPLY ztcp -a $listenfd fd=$REPLY () . host2 ( ) : zmodload zsh/net/tcp ztcp host1 5123 fd=$REPLY $fd . host1: print This is a message >&$fd host2: read -r line <&$fd; print -r - $line `This is a message' . host1: ztcp -c $listenfd ztcp -c $fd host2: ztcp -c $fd ZSH/TERMCAP (THE ZSH/TERMCAP MODULE) zsh/termcap : echotc cap [ arg ... ] termcap cap . zsh/termcap : termcap termcap . ZSH/TERMINFO (THE ZSH/TERMINFO MODULE) zsh/terminfo : echoti cap [ arg ] terminfo cap arg . zsh/terminfo : terminfo terminfo . ZSH/WATCH (THE ZSH/WATCH MODULE) zsh/watch . : LOGCHECK / watch. watch (WATCH ) ( ) / . `all' / . `notme' `all' $USERNAME . `@' `%' (tty) . ( watch ) EXTENDED_GLOB . / . EXTENDED_GLOB : watch=('^(pws|barts)') pws barts . WATCHFMT / watch. `%n has %a %l from %m' . : %n . %a "logged on" "logged off". %l (tty) . %M . %m `.'. IP utmp X-windows . NOTE: `%m' `%M' utmp . . %F{color} (%f) () . %K{color} (%k) () . %S (%s) () (standout). %U (%u) () (underline). %B (%b) () (bold). %t %@ am/pm. %T . %w `day-dd'. %W `mm/dd/yy'. %D `yy-mm-dd'. %D{string} string strftime zsh EXPANSION OF PROMPT SEQUENCES zshmisc(1) . %(x:true-text:false-text) (ternary) . x <<>> <<>> . . . x `l' `n' `m' `M' <<>> `a' <<>> <<>> . . <<>> true-text false-text . <<>> true-text false-text . . zsh/watch : log watch . ZSH/ZFTP (THE ZSH/ZFTP MODULE) zsh/zftp : zftp subcommand [ args ] zsh/zftp (FTP) . / . zsh zshzftpsys(1) . zftp . zftp . . . ZFTP_VERBOSE . (Subcommands) open host[:port] [ user [ password [ account ] ] ] FTP host TCP/IP IP . host:port TCP port FTP ( ) . TCP : ZFTP_PORT . IPv6 port host '[fe80::203:baff:fe02:8b56]'. host . login . host open login . open params . ZFTP_HOST ZFTP_PORT ZFTP_IP ZFTP_SYSTEM `Variables' . login [ name [ password [ account ] ] ] user [ name [ password [ account ] ] ] name password account . (name ). password . . ZFTP_USER ZFTP_ACCOUNT ZFTP_PWD `Variables' . . params [ host [ user [ password [ account ] ] ] ] params - open . . . `?' . stdin login password. `?' ( ). `\' "\\$word" $word `?' . `-' ( ) . open . close (unload) zsh/zftp . : zftp params ftp.elsewhere.xx juser '?Password for juser: ' ftp.elsewhere.xx juser . test ( ) 2 1 0 . test $ZFTP_VERBOSE . . select(2) poll(2) `not supported on this system' . test . cd directory directory . ZFTP_PWD . cdup . cd .. . dir [ arg ... ] ( ) . arg . arg ls `ls -l' . . ls [ arg ... ] () . arg . dir . type [ type ] type type . `A' (ASCII) `I' (Image ) `B' ( `I'). FTP ASCII . zftp open . . . ascii type A. binary type I. mode [ S | B ] (S) (B) . (Stream) (Block) . remote file ... local [ file ... ] . . CCYYMMDDhhmmSS GMT . < > [[ . . remote 2 1 . local ( remote) . put . get file ... file . put file ... file . append file ... put file . getat file point putat file point appendat file point get put append point . . ( ). delete file ... . mkdir directory directory . rmdir directory directory . rename old-name new-name old-name new-name . site arg ... . . quote arg ... FTP . FTP RFC959 . STAT HELP . ZFTP_VERBOSE . close quit . ZFTP_HOST ZFTP_PORT ZFTP_IP ZFTP_SYSTEM ZFTP_USER ZFTP_ACCOUNT ZFTP_PWD ZFTP_TYPE ZFTP_MODE (unset) . session [ sessname ] FTP . `default' . sessname . ( close ) params . zftp . ZFTP_SESSION . rmsession [ sessname ] . . `default' `default' . zftp . (Parameters) zftp . . ZFTP_TMOUT . . . . . . ZFTP_IP . IP . ZFTP_HOST . . IP ZFTP_HOST IP IP . ZFTP_PORT . TCP ( ). FTP . . little-endian 5376 . zftp open . ZFTP_SYSTEM . FTP SYST. "UNIX Type: L8" . ZFTP_TYPE . `A' `I'. type . ZFTP_USER . ( ). ZFTP_ACCOUNT . ( ). . ZFTP_PWD . . ZFTP_CODE . FTP . . ZFTP_REPLY . . . ZFTP_SESSION . FTP session . ZFTP_PREFS zftp. . : P (Passive): . sendport . S passive zftp sendport . S (Sendport): FTP PORT . P passive . D (Dumb): FTP . ZFTP_SYSTEM ZFTP_PWD ASCII . ZFTP_SIZE ( ). ZFTP_PREFS zftp `PS' sendport . ZFTP_VERBOSE 0 5 ( ) . . . RFC959 : 1. (positive preliminary reply). 2. (positive completion reply). 3. (positive intermediate reply). 4. (transient negative completion reply). 5. (permanent negative completion reply). << >> 421 << >> <<>> . 0 : . . . ZFTP_VERBOSE zftp 450 . . (Functions) zftp_chpwd . $ZFTP_PWD . zftp_progress get put append . get . : ZFTP_FILE . ZFTP_TRANSFER G get P put. ZFTP_SIZE : remote local . . (pipe) . ZFTP_COUNT $ZFTP_SIZE . . ZFTP_TRANSFER ZFTP_COUNT . ZFTP_TRANSFER GF PF . ZFTP_COUNT . . unfunction . (Problems) (pipe) . zftp . ( ). zftp . . fork() . . ZSH/ZLE (THE ZSH/ZLE MODULE) zsh/zle Zsh . zshzle(1) . ZSH/ZLEPARAMETER (THE ZSH/ZLEPARAMETER MODULE) zsh/zleparameter Zsh ( zshzle(1) ). keymaps (keymaps) . widgets . . `builtin' `user:name' name `completion:type:name' . type name . ZSH/ZPROF (THE ZSH/ZPROF MODULE) zsh/zprof ( ) . zprof . (unload) . zprof [ -c ] -c zprof . gprof . . . `[num]' . . . . . . ( ). . . . . . zsh/zprof zprof . -c zprof . ZSH/ZPTY (THE ZSH/ZPTY MODULE) zsh/zpty : zpty [ -e ] [ -b ] name [ arg ... ] name eval . (pseudo-terminal) . name zpty . -e (echo) . -b (non-blocking) . REPLY (master) . ZLE ( zshzle(1) ) sysread syswrite ( THE ZSH/SYSTEM MODULE zshmodules(1) ). : sysread syswrite zpty -r zpty -w . zpty -d [ name ... ] -d name . name . HUP . . zpty -w [ -n ] name [ string ... ] -w string name ( ) . -n . string . : -n . tty (EOF) . zpty -r [ -mt ] name [ param [ pattern ] ] -r name . name . . . param param . . param . pattern pattern . . -m . . 2 . -r -t zpty . zpty 1 . pattern : . zpty -t name -t -r name . . . zpty [ -L ] . -L zpty . ZSH/ZSELECT (THE ZSH/ZSELECT MODULE) zsh/zselect : zselect [ -rwe ] [ -t timeout ] [ -a array ] [ -A assoc ] [ fd ... ] zselect `select' . 2 ( 1 ). select(2) . . . . zselect . -r -w -e . . ( << >> select . POSIX <<>> (exception) . zsh -e .) `-t timeout' . zselect . zselect `sleep' timeout 1 . `-a array' array () . reply . zselect . : zselect -t 0 -r 0 -w 1 0 $reply `-r 0 -w 1' . `-A assoc' assoc () . -a reply . assoc `rwe' . 0 . 1 ( ). select . ZSH/ZUTIL (THE ZSH/ZUTIL MODULE) zsh/zutil : zstyle [ -L [ metapattern [ style ] ] ] zstyle [ -e | - | -- ] pattern style string ... zstyle -d [ pattern [ style ... ] ] zstyle -g name [ pattern [ style ] ] zstyle -{a|b|s} context style name [ sep ] zstyle -{T|t} context style [ string ... ] zstyle -m context style pattern (styles) . . `context' () . . ( ) `*' . `*' . . `weather' preferred-precipitation `:weather:continent:day-of-the-week:phase-of-the-moon' . zshrc : zstyle ':weather:europe:*' preferred-precipitation rain zstyle ':weather:*:Sunday:*' preferred-precipitation snow : zstyle -s ":weather:${continent}:${day_of_week}:${moon_phase}" preferred-precipitation REPLY $REPLY . $REPLY `snow' `rain' `snow' `:weather:europe:*' `:weather:*:Sunday:*' context zstyle -s ( ). : zstyle [ -L [ metapattern [ style ] ] ] . zstyle . -L zstyle . metapattern pattern . : `zstyle -L ":completion:*"' `:completion:' ":completion:*": ':completion:\*' . style ( ). -L . zstyle [ - | -- | -e ] pattern style string ... style pattern string . -e string ( ) ( eval ) . `reply' . reply . zstyle -d [ pattern [ style ... ] ] . pattern style pattern . zstyle -g name [ pattern [ style ] ] . name . . pattern pattern style . : zstyle -s context style name [ sep ] name . ( sep ) . 0 1 . zstyle -b context style name (boolean) name `yes' `true' `on' `1' `yes' . `no' . name `yes' 0 1 . zstyle -a context style name name . name . 0 1 . zstyle -t context style [ string ... ] zstyle -T context style [ string ... ] -t ($? ). string `true' `yes' `on' `1' . string string . 1 . 2 . -T -t ( 2) . zstyle -m context style pattern . pattern . zformat -f param format spec ... zformat -F param format spec ... zformat -a array sep spec ... . -f . format spec . spec `char:string' `%char' format string . `%' `%' `char' `%min.maxc' . string . . string (truncate) . `%' spec param . `%%' % . % . % `(' . `(' . . <<>> <<>> . ( ) `%(X.text1.text2)' `.' . char:string . text1 text2 . text2 %) . text1 text2 % . : zformat -f REPLY "The answer is '%3(c.yes.no)'." c:3 "The answer is 'yes'." REPLY c 3 . -F -f <<>> <<>> . . . -a . spec `left:right' `left' `right' . sep left sep ( right ) . right . . left . array . zregexparse _regex_arguments . zparseopts [ -D -E -F -K -M ] [ -a array ] [ -A assoc ] [ - ] spec ... ( $*) . spec `opt[=array]' . opt array -a `=array' . spec `=array' -a -A . -E spec . -E `-' `--' . -F . opt . . name name+ name `-' . GNU `-' name `--file' name `-file' . `+' name array `+' . `-' ( -E ). name: name:- name:: . array . ( ). `:-' . `+' name . . `-' . `=' GNU spec `-foo:' `--foo=bar' `--foo' `=bar' . spec `-foo -foobar' ( ) . spec ( `-foo: -foobar') . spec . zparseopts (stack ) `-DEK' spec GNU `--DEK' . zparseopts : -a array . -A assoc ( ) . -D ( ) spec . `-' `--' . shift . -E spec . ( -D) . `-' `--' spec -D . -F zparseopts spec 1 . (-D) (-E) . . . -K -a `=array' spec . spec . -A -K . zparseopts . -M . spec `=array' array spec . spec . $* `name+' . : set -- -a -bx -c y -cz baz -cend zparseopts a=foo b:=bar c+:=bar : foo=(-a) bar=(-b x -c y -c z) `baz' . -E : set -- -a x -b y -c z arg1 arg2 zparseopts -E -D b:=bar : bar=(-b y) set -- -a x -c z arg1 arg2 -b bar . -M : set -- -a -bx -c y -cz baz -cend zparseopts -A bar -M a=foo b+: c:=b : foo=(-a) bar=(-a '' -b xyz) zsh 5.9.2 July 12, 2026 ZSHMODULES(1)