6 zsh-lovers - tips, tricks and examples for the Z shell
14 Whenever we look at the zsh manual we wonder why there are no examples or those
15 simply things in (shell) life. The zsh contains many features, but there was no
16 manpage with some examples (like procmailex(5)). That's why we wrote this
19 Most of the tricks and oneliner come from the mailinglists zsh-users,
20 zsh-workers, google, newsgroups and from ourself. See section *LINKS* for
23 Note: This manpage (zsh-lovers(1)) is *not* an offical part of the Z shell! It's
24 just a just for fun - manpage ;) +
25 For comments, bugreports and feedback take a quick look at the section *BUGS*.
29 This section provides some examples for often needed shellscript-stuff. Notice
30 that you should not use otherwise most examples won't work. +
31 Parse options in shellscripts. Example taken from ZWS by Adam Chodorowski
32 (http://www.chodorowski.com/projects/zws/[]):
33 ----------------------------------------------
40 zparseopts -K -- p:=o_port r:=o_root h=o_help
41 if [[ $? != 0 || "$o_help" != "" ]]; then
42 echo Usage: $(basename "$0") "[-p PORT] [-r DIRECTORY]"
50 if [[ $root[1] != '/' ]]; then root="$PWD/$root"; fi
52 # now use the function:
54 ----------------------------------------------
58 Available subsections are *Aliases*, *Completion*, *Unsorted/Misc examples*,
59 *(Recursive) Globbing - Examples*, *Modifiers usage*, *Redirection-Examples*,
60 *ZMV-Examples* and *Module-Examples*.
64 Suffix aliases are supported in zsh since version 4.2.0. Some examples:
70 Now pressing return-key after entering 'foobar.vim' starts vim with
71 foobar.vim. Calling a html-file runs browser w3m. 'www.zsh.org' and pressing
72 enter starts w3m with argument www.zsh.org. +
73 Global aliases can be used anywhere in the command line. Example:
74 ----------------------
75 $ alias -g C='| wc -l'
76 $ grep alias ~/.zsh/* C
78 ----------------------
79 Some more or less useful global aliases (choose whether they are useful or not
81 --------------------------------------------------------
83 alias -g ....='../../..'
84 alias -g .....='../../../..'
85 alias -g CA="2>&1 | cat -A"
87 alias -g D="DISPLAY=:0.0"
89 alias -g ED="export DISPLAY=:0.0"
90 alias -g EG='|& egrep'
93 alias -g ELS='|& less -S'
94 alias -g ETL='|& tail -20'
99 alias -g HL='|& head -20'
100 alias -g Sk="*~(*.bz2|*.gz|*.tgz|*.zip|*.z)"
101 alias -g LL="2>&1 | less"
103 alias -g LS='| less -S'
106 alias -g NE="2> /dev/null"
107 alias -g NS='| sort -n'
108 alias -g NUL="> /dev/null 2>&1"
110 alias -g R=' > /c/aaa/tee.txt '
111 alias -g RNS='| sort -nr'
113 alias -g TL='| tail -20'
115 alias -g US='| sort -u'
116 alias -g VM=/var/log/messages
117 alias -g X0G='| xargs -0 egrep'
118 alias -g X0='| xargs -0'
119 alias -g XG='| xargs egrep'
121 --------------------------------------------------------
125 See also man 1 zshcompctl zshcompsys zshcompwid. zshcompctl is the old
126 style of zsh programmable completion, zshcompsys is the new completion
127 system, zshcompwid are the zsh completion widgets.
129 Some functions, like _apt and _dpkg, are very slow. You can use a cache
130 in order to proxy the list of results (like the list of available
131 debian packages) Use a cache:
132 ---------------------------------------------------------------------------------------------------
133 zstyle ':completion:*' use-cache on
134 zstyle ':completion:*' cache-path ~/.zsh/cache
135 ---------------------------------------------------------------------------------------------------
137 Prevent CVS files/directories from being completed:
138 ---------------------------------------------------------------------------------------------------
139 zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
140 zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
141 ---------------------------------------------------------------------------------------------------
143 Fuzzy matching of completions for when you mistype them:
144 ---------------------------------------------------------------------------------------------------
145 zstyle ':completion:*' completer _complete _match _approximate
146 zstyle ':completion:*:match:*' original only
147 zstyle ':completion:*:approximate:*' max-errors 1 numeric
148 ---------------------------------------------------------------------------------------------------
150 And if you want the number of errors allowed by _approximate to
151 increase with the length of what you have typed so far:
152 ---------------------------------------------------------------------------------------------------
153 zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'
154 ---------------------------------------------------------------------------------------------------
156 Ignore completion functions for commands you don't have:
157 ---------------------------------------------------------------------------------------------------
158 zstyle ':completion:*:functions' ignored-patterns '_*'
159 ---------------------------------------------------------------------------------------------------
161 With helper functions like:
162 ---------------------------------------------------------------------------------------------------
163 xdvi() { command xdvi ${*:-*.dvi(om[1])} }
164 ---------------------------------------------------------------------------------------------------
166 you can avoid having to complete at all in many cases, but if you do,
167 you might want to fall into menu selection immediately and to have the
168 words sorted by time:
169 ---------------------------------------------------------------------------------------------------
170 zstyle ':completion:*:*:xdvi:*' menu yes select
171 zstyle ':completion:*:*:xdvi:*' file-sort time
172 ---------------------------------------------------------------------------------------------------
174 Completing process IDs with menu selection:
175 ---------------------------------------------------------------------------------------------------
176 zstyle ':completion:*:*:kill:*' menu yes select
177 zstyle ':completion:*:kill:*' force-list always
178 ---------------------------------------------------------------------------------------------------
180 If you end up using a directory as argument, this will remove the
181 trailing slash (usefull in ln)
182 ---------------------------------------------------------------------------------------------------
183 zstyle ':completion:*' squeeze-slashes true
184 ---------------------------------------------------------------------------------------------------
186 cd will never select the parent directory (e.g.: cd ../<TAB>):
187 ---------------------------------------------------------------------------------------------------
188 zstyle ':completion:*:cd:*' ignore-parents parent pwd
189 ---------------------------------------------------------------------------------------------------
191 UNSORTED/MISC examples
192 ~~~~~~~~~~~~~~~~~~~~~~
193 Hint: A list of valid glob Qualifiers can be found in zshexpn(1).
194 See ``man 1 zshexpn | less -p'' Qualifiers for details.
196 -------------------------------------------------------------------------------
197 # Show me all the .c files for which there doesn't exist a .o file.
198 $ c=(*.c) o=(*.o(N)) eval 'ls ${${c:#(${~${(j:|:)${o:r}}}).c}:?done}'
200 # All files in /var/ that are not owned by root
201 $ ls -ld /var/*(^u:root)
203 # All files for which the owner hat read and execute permissions
206 # The same, but also others dont have execute permissions
207 $ echo *(f:u+rx,o-x:)
209 # brace expansion - example
212 $ print -r -- $^X.$^Y
213 A.+ A.- B.+ B.- C.+ C.-
215 # Fetch the newest file containing the string 'fgractg*.log' in the
216 # filename and contains the string 'ORA-' in it
217 $ file=(fgractg*.log(Nm0om[1]))
218 $ (($#file)) && grep -l ORA- $file
220 $ files=$( find . -name . -o -prune -name 'fgractg*>log' -mtime 0 -print )
221 > if [ -n "$files" ]; then
225 > file=$(ls -td $files | head -1)
226 > grep -l ORA- "$file"
229 # keep specified number of child processes running until entire task finished
230 $ zsh -c 'sleep 1 & sleep 3 & sleep 2& print -rl -- $jobtexts'
232 # Remove zero length and .bak files in a directory
233 $ rm -i *(.L0) *.bak(.)
235 # print out files that dont have extensions
236 $ printf '%s\n' ^?*.*
237 $ printf '%s\n' ^?*.[^.]*(D)
240 # Finding files which does not contain a specific string
241 $ print -rl file* | comm -2 -3 - <(grep -l string file*)'
242 $ for f (file*(N)) grep -q string $f || print -r $f'
244 # Show/Check whether a option is set or not. It works both with $options as
246 $ echo $options[correct]
251 # Count the number of directories on the stack
252 $ print $((${${(z)${(f)"$(dirs -v)"}[-1]}[1]} + 1)) # or
253 $ dirs -v | awk '{n=$1}END{print n+1}'
255 # Matching all files which do not have a dot in filename
258 # Show only the ip-address from ``ifconfig device''
259 $ print ${${$(LC_ALL=C /sbin/ifconfig eth0)[7]}:gs/addr://} # ifconfig from net-tools (Linux)
260 $ print ${$(/sbin/ifconfig tun0)[6]} # ifconfig from 4.2BSD {Free,Net,Open}BSD
262 # Ping all the IP addresses in a couple of class C's or all hosts into /etc/hosts
263 $ for i in {1..254}; do ping -c 1 192.168.13.$i; done
265 $ I=1; while ( [[ $I -le 255 ]] ) ; do ping -1 2 150.150.150.$I; let I++; done
267 $ for i in $(sed 's/#.*//' > /etc/hosts | awk '{print $2}')
269 : echo "Trying $i ... "
271 : echo '============================='
274 # load all available modules at startup
277 $ for md ($module_path) m=($m $md/**/*(*e:'REPLY=${REPLY#$md/}'::r))
280 # Rename all files within a directory such that their names get a numeral prefix in the default sort order.
281 $ i=1; for j in *; do mv $j $i.$j; ((i++)); done
282 $ i=1; for f in *; do mv $f $(echo $i| awk '{ printf("%03d", $0)}').$f; ((i++)); done
283 $ integer i=0; for f in *; do mv $f $[i+=1].$f; done
285 # Find (and print) all symbolic links without a target within the current dirtree.
286 $ $ file **/*(D@) | fgrep broken
287 $ for i in **/*(D@); [[ -f $i || -d $i ]] || echo $i
288 $ echo **/*(@-^./=%p)
291 # List all plain files that do not have extensions listed in `fignore'
292 $ ls **/*~*(${~${(j/|/)fignore}})(.)
293 # see above, but now omit executables
294 $ ls **/*~*(${~${(j/|/)fignore}})(.^*)
296 # Print out files that dont have extensions (require setopt extendedglob dotglob)
297 $ printf '%s\n' ^?*.*
299 # List files in reverse order sorted by name
302 $ print -rl -- *(^on)
304 # Synonymic to ``ps ax | awk '{print $1}'''
305 $ print -l /proc/*/cwd(:h:t:s/self//)
307 # Get the PID of a process (without ``ps'', ``sed'', ``pgrep'', .. (under Linux)
310 > for i in /proc/<->/stat
312 > [[ "$(< $i)" = *\((${(j:|:)~@})\)* ]] && echo $i:h:t
316 # for X in 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y'; do ...
317 $ for (( i = 36#n; i <= 36#y; i++ )); do
318 > print ${$(([##36]i)):l}
320 # or in combination with ``dc''
321 $ print {$((##n))..$((##y))}P\ 10P | dc
323 $ eval print '${$(([##36]'{$((36#n))..$((36#y))}')):l}'
325 # foreach in one line of shell
326 $ for f (*) print -r -- $f
328 # copy a directory recursively without data/files
333 $ find . -type d -exec env d="$dest_root" sh -c ' exec mkdir -p -- "$d/$1"' '{}' '{}' \;
335 # If `foo=23'', then print with 10 digit with leading '0'.
337 $ print ${(r:10::0:)foo}
339 # find the name of all the files in their home directory that have more than 20 characters in their file names
340 print -rl $HOME/${(l:20::?:)~:-}*
343 $ print -r -- ${(qq)m} > $nameoffile # save it
344 $ eval "m=($(cat -- $nameoffile)" # or use
345 $ m=("${(@Q)${(z)"$(cat -- $nameoffile)"}}") # to restore it
347 # get a "ls -l" on all the files in the tree that are younger than a specified age (e.g
348 # "ls -l" all the files in the tree that where modified in the last 2 days)
350 # This will give you a listing 1 file perl line (not à la ls -R).
351 # Think of an easy way to have a "ls -R" style output with
352 # only files newer than 2 day old.
353 $ for d (. ./**/*(/)) {
354 > print -r -- $'\n'${d}:
357 > (($#l)) && ls -ltd -- $l
361 # If you also want directories to be included even if their mtime
362 # is more than 2 days old:
363 $ for d (. ./**/*(/)) {
364 > print -r -- $'\n'${d}:
367 > (($#l)) && ls -ltd -- $l
371 # And if you want only the directories with mtime < 2 days to be listed:
372 $ for d (. ./**/*(N/m-2)) {
373 > print -r -- $'\n'${d}:
376 > (($#l)) && ls -ltd -- $l
384 $ echo ${(l:$COLUMNS::-:)}
385 # and now with colors (require autoload colors ;colors)
386 $ echo "$bg[red]$fg[black]${(l:42::-:)}"
388 # Redirect STDERR to a command like xless without redirecting STDOUT as well.
390 # but this executes the command asynchronously. To do it synchronously:
391 $ { { foo 1>&3 } 2>&1 | xless } 3>&1
393 # Rename all MP3-Files from name with spaces.mp3 to Name With Spaces.mp3
395 > mv $i ${${(C)i}:s/Mp3/mp3/}
398 # Match file names containing only digits and ending with .xml (requiresetopt kshglob)
402 # Remove all "non txt" files
405 # Move 200 files from a directory into another
406 $ mv -- *([1,200]) /another/Dir
408 # Convert images (foo.gif => foo.png):
409 $ for i in **/*.gif; convert $i $i:r.png
411 # convert a collection of mp3 files to wave or cdr (e.g. file.wav -> file.mp3)
412 $ for i (./*.mp3){mpg321 --w - $i > ${i:r}.wav}
414 # Download with LaTeX2HTML created Files (for example the ZSH-Guide):
415 $ for f in http://zsh.sunsite.dk/Guide/zshguide{,{01..08}}.html; do
416 > lynx -source $f >${f:t}
419 # Move all files in dir1 and dir2 that have line counts greater than 10 to another directory say "/more10"
420 $ mv dir[12]/**/*.cr(-.e{'((`wc -l < $REPLY` > 10))'}) /more10
422 # Make with dpkg a master-list of everyfile that it has installed
423 $ diff <(find / | sort) <(cat /var/lib/dpkg/info/*.list | sort)
425 # Replace this fucking Escape-Sequences:
426 $ autoload colors ; colors
427 $ print "$bg[cyan]$fg[blue]You are a idiot" >> /dev/pts/3
429 # Get ASCII value of a character
430 $ char=N ; print $((#char))
432 # Filename "Erweiterung"
433 # Note: The (N) says to use the nullglob option for this particular glob pattern.
434 $ for i in *.o(N); do
438 # Rename files; i. e. FOO to foo and bar to BAR
439 $ for i in *(.); mv $i ${i:l} # `FOO' to `foo'
440 $ for i in *(.); mv $i ${i:u} # `bar to `BAR'
442 # Show all suid-files in $PATH
443 $ ls -latg ${(s.:.)PATH} | grep '^...s'
445 $ print -l ${^path}/*(Ns,S)
446 # or show only executables with a user given pattern
447 $ print -l ${^path}/*vim*(*N)
449 # gzip files when containing a certain string
450 $ gzip ${(ps:\0:)"$(grep -lZ foobar ./*.txt(.))"}
452 # A small one-liner, that reads from stdin and prints to stdout the first unique line
453 # i. e. does not print lines that have been printed before (this is similar to the unique
454 # command, but unique can only handle adjacent lines).
455 $ IFS=$'\n\n'; print -rl -- ${(Oau)${(Oa)$(cat file;echo .)[1,-2]}}
457 # Lists every executable in PATH
458 $ print -l ${^path}/*(-*N)
460 # Match all .c files in all subdirectories, _except_ any SCCS subdirectories?
461 $ ls **/*.c~(*/)#SCCS/*
463 # List all `README' - files case-insensitive with max. one typo
464 $ ls **/*(#ia2)readme
466 # case insensitive checking for variables
467 $ if [[ $OSTYPE == (#i)LINUX*(#I) ]]; then
468 > echo "Penguin on board."
470 > echo "Not a Linux."
472 -------------------------------------------------------------------------------
474 (Recursive) Globbing - Examples
475 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
476 A list of valid glob Qualifiers can be found in zshexpn(1). *Note:*
477 \*\*/ is equivalent to (*/)#! For example:
478 -------------------------------------------------------------------------------
479 $ print (*/)#zsh_us.ps
480 zsh-4.2.3/Doc/zsh_us.ps
482 zsh-4.2.3/Doc/zsh_us.ps
483 -------------------------------------------------------------------------------
485 -------------------------------------------------------------------------------
486 # Search for `README' in all Subdirectories
489 # find directories that contain both "index.php" and "index.html", or in general, directories
490 # that contain more than one file matching "index.*"
491 $ ls **/*(D/e:'[[ -e $REPLY/index.php && -e $REPLY/index.html ]]':)
493 $ ls **/*(D/e:'l=($REPLY/index.*(N)); (( $#l >= 2 ))':)
495 # Find command to search for directory name instead of basename
496 $ print -rl /**/*~^*/path(|/*)
498 $ find / | grep -e /path/ -e '/path$'
500 # Print he path of the directories holding the ten biggest C regular files in the current
501 # directory and subdirectories.
502 $ print -rl -- **/*.c(D.OL[1,10]:h) | sort -u
504 # Find files with size == 0 and send a mail
505 $ files=(**/*(ND.L0m+0m-2))
506 > (( $#files > 0 )) && print -rl -- $files | mailx -s "empty files" foo@bar.tdl
509 $ chmod 700 **/(.) # Only files
510 $ chmod 700 **/(/) # Only directories
512 # print out all of the files in that directory in 2 columns
513 $ print -rC2 -- ${1:[...]}/*(D:t)
514 # ^- number ob columns
515 # or - if you feel concerned about special characters - use
516 $ list=(${1:[...]}/*(ND:t))
517 $ (($#list)) && print -rC2 -- ${(V)list}
519 # Search all files in /home/*/*-mail/ with a setting ``chmod -s'' flag (recursive, include
520 # dotfiles) remove the setgid/setuid flag and print a message
521 $ chmod -s /home/*/*-mail(DNs,S) /home/*/*-mail/**/*(DNs,S))
522 # or with a small script
523 $ for file (/home/*/*-mail(DNs,S) /home/*/*-mail/**/*(DNs,S)) {
525 > chmod -s $file && print -r fixed $file
527 # or use ``zargs'' (require autoload zargs) prevent the arg list too long error
528 $ zargs /home/*/*-mail(DNs,S) /home/*/*-mail/**/*(DNs,S)) -- chmod -s
530 # List files beginning at `foo23' upwards (foo23, foo24, foo25, ..)
533 # get all files that begin with the date strings from June 4 through June 9 of 2004
534 $ ls -l 200406{04..10}*(N)
535 # or if they are of the form 200406XX (require ``setopt extended_glob''
536 $ ls -l 200306<4-10>.*
538 # remove spaces from filenames
539 $ for a in ./**/*\ *(Dod); do mv $a ${a:h}/${a:t:gs/ /_}; done
541 # Show only all *.c and *.h - Files
544 # Show only all *.c - files and ignore `foo.c'
547 # show data to *really* binary format
548 $ zsh -ec 'while {} {printf %.8x $n;repeat 8 \
549 > {read -ku0 a printf \ %.8d $(([##2]#a))};print;((n+=8))}' < binary
551 # Show only world-readable files
554 # List files in the current directory are not writable by the owner
555 $ print -l ~/*(ND.^w)
557 # find and delete the files which are older than a given parameter (seconds/minutes/hours)
558 $ rm -f /Dir/**/*(.mh+3) # deletes all regular file in /Dir that are older than 3 hours
559 $ rm -f /Dir/**/*(@mm+3) # deletes all symlinks in /Dir that are older than 3 minutes
560 $ rm -f /Dir/**/*(ms+30^/) # deletes all non dirs in /Dir that are older than 30 seconds
561 $ rm ./**/*(.Dmh+1,.DL0) # deletes all folders, sub-folders and files older than one hour
562 $ rm -f **/*(mh+6) # deletes all files more than 6 hours old
563 $ rm ./*(Om[1,-11]) # removes all files but the ten newer ones (delete all but last 10 files in a directory)
564 Note: If you get a arg list too long, you use the builtin rm. For example:
565 $ zmodload zsh/files ; rm -f **/*(mh+6)
566 or use the zargs function:
567 $ autoload zargs ; zargs **/*(mh+6) -- rm -f
569 # A User's Guide to the Z-Shell /5.9: Filename Generation and Pattern Matching
570 # find all files in all subdirectories, searching recursively, which have a given
571 # name, case insensitive, are at least 50 KB large, no more than a week old and
572 # owned by the root user, and allowing up to a single error in the spelling of
573 # the name. In fact, the required expression looks like this:
574 $ ls **/(#ia1)name(LK+50mw-1u0)
576 # Change the UID from 102 to 666
577 $ chown 666 **/*(u102)
579 # List all files which have not been updated since last 10 hours
580 $ print -rl -- *(Dmh+10^/)
582 # delete only the oldest file in a directory
583 $ rm ./*filename*(Om[1])
585 # Sort the output from `ls -l' by file size
588 # find most recent file in a directory
589 $ setopt dotglob ; print directory/**/*(om[1])
591 # Show only empty files which nor `group' or `world writable'
594 # find - and list - the ten newest files in directories and subdirs (recursive)
595 $ print -rl -- **/*(Dom[1,10])
597 # Print only 5 lines by "ls" command (like ``ls -laS | head -n 5'')
600 # display the 5-10 last modified files
601 $ print -rl -- /path/to/dir/**/*(D.om[5,10])
603 # find all files without a valid owner
604 $ chmod someuser /**/*(D^u:${(j.:u:.)${(f)"$(</etc/passwd)"}%%:*}:)
606 # find all the empty directories in a tree
607 $ for f in ***/*(/l2); do foo=($f/*(N)); [[ -z $foo ]] && print $f; done
608 # Note:Since Zsh 4.2.1(?) the glob qualifier F indicates a non-empty directory.
609 Hence *(F) indicates all subdirectories with entries, *(/^F) means all subdirectories with no
613 # remove empty directories afterwards
614 $ rmdir ./**/*(/od) 2> /dev/null
616 # Show only files are owned from group `users'
619 -------------------------------------------------------------------------------
623 Modifiers are a powerful mechanism that let you modify the results
624 returned by parameter, filename and history expansion. See zshexpn(1)
626 -------------------------------------------------------------------------------
627 # Remove a trailing pathname component, leaving the head. This works like `dirname'.
631 # Remove all leading pathname components, leaving the tail. This works like `basename'.
635 # Remove the suffix from each file (*.sh in this example)
636 $f:e is $f file extension
637 :h --> head (dirname)
638 :t --> tail (basename)
639 :r --> rest (extension removed)
640 $ for f (*.sh) mv $f $f:r
642 # Remove a filename extension of the form `.xxx', leaving the root name.
648 # Remove all but the extension.
655 # Print the new command but do not execute it. Only works with history expansion.
661 # Quote the substituted words, escaping further substitutions.
668 # Convert the words to all lowercase.
675 # Convert the words to all uppercase.
682 # convert 1st char of a word to uppercase
683 $ foo="one two three four"
684 $ print -r -- "${(C)var}"
686 -------------------------------------------------------------------------------
690 See zshmisc(1) for more informations (or less ${^fpath}/zmv(N))
692 -------------------------------------------------------------------------------
693 # Append `exit 1' at the end of all *.sh - files
694 $ echo "exit 1" >> *.sh
696 # adding files to foobar.tar.gz
697 $ eval set =(gunzip < foobar.tar.gz) '
698 tar rf $1 additional.txt &&gzip < $1 > foobar.tar.gz'
700 # Redirect output to a file AND display on screen
701 $ foobar >&1 > file1 > file2 > ..
703 # pipe single output to multiple inputs
704 $ zcat foobar.Z >> (gzip -9 > file1.gz) \
705 >> (bzip2 -9 > file1.bz2) \
706 >> (acb --best > file1.acb)
708 # Append /etc/services at the end of file `foo' and `bar'
709 $ cat /etc/services >> foo >> bar
712 $ echo An error >&2 2>&1 | sed -e 's/A/I/'
714 # send standard output of one process to standard input of several processes in the pipeline
716 $ process1 > >(process1) > >(process2)
718 # initializing a variable and simultaneously keeping terminal output
720 $ { a=$(command >&1 >& 3 3 > &- 2>&1);} 3>&1
722 # redirect stderr two times
723 $ setopt multios ; program 2> file2 > file1 2>&1
725 # Duplicating stdout and stderr to a logfile
726 $ exec 3>&1 > logfile 2>&2 2>&1 >&3 3>&-
728 # redirect stderr (only) to a file and to orig. stderr:
729 $ command 2>&2 2>stderr
730 # redirect stderr and stdout to separate files and both to orig. stdout:
731 $ command 2>&1 1>&1 2>stderr 1>stdout
732 # redirect stderr and stdout to separate files and stdout to orig. stdout AND stderr to orig. stderr:
733 $ command 2>&2 1>&1 2>stderr 1>stdout
735 # More fun with STDERR ;)
736 $ ./my-script.sh 2> >(grep -v moron >error.log) | process-output > output.log
737 $ echo "Thats STDOUT" >>(sed 's/stdout/another example/' > foobar)
738 -------------------------------------------------------------------------------
740 ZMV-Examples (require autoload zmv)
741 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
742 *Note:* '-n' means no execution (just print what would happen). At
743 -------------------------------------------------------------------------------
744 # serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)
747 1.c asd.foo bla.foo fnord.foo foo.fnord foo.foo
748 $ c=1 zmv '*.foo' '$((c++)).foo'
750 1.c 1.foo 2.foo 3.foo 4.foo foo.fnord
752 # Rename "file.with.many.dots.txt" by substituting dots (exept for the last
754 $ touch {1..20}-file.with.many.dots.txt
755 $ zmv '(*.*)(.*)' '${1//./ }$2'
757 # Remove the first 4 chars from a filename
758 $ zmv -n '*' '$f[5,-1]' # NOTE: The "5" is NOT a mistake in writing!
760 # Rename names of all files under the current Dir to lower case, but keep Dir names as-is.
761 $ zmv -Qv '(**/)(*)(.D)' '$1${(L)2}'
763 # replace all 4th character, which is "1", with "2" and so on
765 $ zmv '(???)1(???[1-4].txt)' '${1}2${2}'
767 # Remove the first 15 characters from a string
768 $ touch 111111111111111{a-z}
770 $ zmv '*' '$f[16,-1]'
772 # Replace spaces (any number of them) with a single dash in file names
774 $ zmv -n '(**/)(* *)' '$1${2//( #-## #| ##)/-}'
776 $ find . -depth -name '* *' -exec bash -c '
781 > newname=${name//*([ -]) *([ -])/-}
782 > mv -i -- "$file" "$Dir/$newname"' {} {} \;
784 # Clean up file names and remove special characters
786 $ zmv -n '(**/)(*)' '$1${2//[^A-Za-z0-9._]/_}'
788 # Add *.py to a bunch of python scripts in a directory (some of them end in *.py and give them
789 # all a proper extension
791 $ zmv -n '(**/)(con*)(#qe,file $REPLY | grep "python script",)' '$1$2.py'
793 # lowercase all extensions (i. e. *.JPG) incl. subfolders
795 $ zmv '(**/)(*).(#i)jpg' '$1$2.jpg'
797 $ find Dir -name '*.[jJ][pP][gG]' -print | while read f
801 > *) mv "$f" "${f%.*}.jpg" ;
805 # remove leading zeros from file extension
808 filename.001 filename.003 filename.005 filename.007 filename.009
809 filename.002 filename.004 filename.006 filename.008 filename.010
810 $ zmv '(filename.)0##(?*)' '$1$2'
812 filename.1 filename.10 filename.2 filename.3 filename.4 filename.5 filename.6 ...
817 foo_10.jpg foo_2.jpg foo_3.jpg foo_4.jpg foo_5.jpg foo_6.jpg foo_7.jpg foo_8.jpg foo_9.jpg
818 $ zmv -fQ 'foo_(<0->).jpg(.nOn)' 'foo_$(($1 + 1)).jpg'
820 foo_10.jpg foo_11.jpg foo_3.jpg foo_4.jpg foo_5.jpg foo_6.jpg foo_7.jpg foo_8.jpg foo_9.jpg
822 # adding leading zeros to a filename (1.jpg -> 001.jpg, ..
824 $ zmv '(<1->).jpg' '${(l:3::0:)1}.jpg'
826 # See above, but now only files with a filename >= 30 chars
828 $ c=1 zmv "${(l:30-4::?:)}*.foo" '$((c++)).foo'
830 # Replace spaces in filenames with a underline
832 $ zmv '* *' '$f:gs/ /_'
834 # Change the suffix from *.sh to *.pl
836 $ zmv -W '*.sh' '*.pl'
838 # Add a "".txt" extension to all the files within ${HOME}
839 # ``-.'' is to only rename regular files or symlinks to regular files,
840 # ``D'' is to also rename hidden files (dotfiles))
842 $ zmv -Q '/home/**/*(D-.)' '$f.txt'
843 # Or to only rename files that don't have an extension:
844 $ zmv -Q '/home/**/^?*.*(D-.)' '$f.txt'
846 # Recursively change filenames with characters ? [ ] / = + < > ; : " , - *
848 $ chars='[][?=+<>;",*-]'
849 $ zmv '(**/)(*)' '$1${2//$~chars/%}'
851 # Removing single quote from filenames (recursively)
853 $ zmv -Q "(**/)(*'*)(D)" "\$1\${2//'/}"
855 # When a new file arrives (named file.txt) rename all files in order to get (e. g.
856 # file119.txt becomes file120.txt, file118.txt becomes file119.txt and so on ending
857 # with file.txt becoming file1.txt
859 $ zmv -fQ 'file([0-9]##).txt(On)' 'file$(($1 + 1)).txt'
861 # lowercase/uppercase all files/directories
863 $ zmv '(*)' '${(L)1}' # lowercase
864 $ zmv '(*)' '${(U)1}' # uppercase
866 # Remove the suffix *.c from all C-Files
870 # Uppercase only the first letter of all *.mp3 - files
872 $ zmv '([a-z])(*).mp3' '${(C)1}$2.mp3'
874 # Copy the target `README' in same directory as each `Makefile'
876 $ zmv -C '(**/)Makefile' '${1}README'
878 # Removing single quote from filenames (recursively)
880 $ zmv -Q "(**/)(*'*)(D)" "\$1\${2//'/}"
882 # Rename pic1.jpg, pic2.jpg, .. to pic0001.jpg, pic0002.jpg, ..
884 $ zmv 'pic(*).jpg' 'pic${(l:4::0:)1}.jpg'
885 $ zmv '(**/)pic(*).jpg' '$1/pic${(l:4::0:)2}.jpg' # recursively
886 -------------------------------------------------------------------------------
890 Please read zshmodules(1) first!
892 zsh/pcre (require zmodload zsh/pcre)
893 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
895 -------------------------------------------------------------------------------
896 # Copy files of a certain period (date indicated in the filenames)
898 $ ls -d -- *(e:'[[ $REPLY -pcre-match pcre-regexp ]]':)
900 $ m() { [[ $1 -pcre-match pcre-regexp ]] }
902 -------------------------------------------------------------------------------
904 zsh/clone (require zmodload zsh/clone)
905 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
906 -------------------------------------------------------------------------------
907 # Creates a forked instance of the current shell ($! is set to zero) and
908 # execute ``command'' on /dev/tty8 (for this example).
910 $ clone /dev/tty8 && (($! == 0)) && exec command
911 -------------------------------------------------------------------------------
913 zsh/datetime (require zmodload zsh/datetime)
914 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
915 -------------------------------------------------------------------------------
916 $ zmodload zsh/datetime
917 $ alias datereplacement='strftime "%Y-%m-%d" $EPOCHSECONDS'
918 $ export DATE=`datereplacement`
921 # strip date from filename
922 $ $ zmodload zsh/datetime
923 $ setopt extendedglob
924 $ touch aaa_bbb_20041212_c.dat eee_fff_20051019_g.dat
925 $ strftime -s pattern '???_???_<0-%Y%m%d>_?.dat' $((EPOCHSECONDS - 365 * 24 * 60 * 60 / 2))
926 $ print -rl -- $~pattern
927 aaa_bbb_20041212_c.dat
928 $ print -rl -- $pattern
929 ???_???_<0-20050815>_?.dat
931 # Search files size == 0, to be based on the file name containing a date rather than the "last
932 # modified" date of the file
933 $ zmodload -i zsh/datetime
934 $ strftime -s file "abc_de_%m%d%Y.dat" $((EPOCHSECONDS - 24 * 60 * 60 ))
935 $ files=(**/$file(N.L0))
936 $ (( $#files > 0 )) && print -rl -- $files | mailx -s "empty files" foo@bar.tdl
937 -------------------------------------------------------------------------------
939 zsh/stat (require zmodload zsh/stat)
940 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
941 -------------------------------------------------------------------------------
942 # comparing file dates
946 $ touch bar & sleep 5 & touch foo
947 $ echo $file1 is $(( $(stat +mtime $file2) - $(stat +mtime $file1) )) seconds older than $file2.
948 bar is 5 seconds older than foo
950 # list the files of a disk smaller than some other file
952 $ stat -A max +size some-other-file
953 $ print -rl ./**/*(D.L-$max)
955 # List the top 100 biggest files in a disk
957 $ ls -fld ./**/*(d`stat +device .`OL[1,100])
959 # Get only the user name and the file names from (like ls -l * | awk '{print $3" " $8}')
962 > stat -sA user +uid -- "$file" &&
963 > print -r -- "$user" "$file"
966 # get the difference between actual bytes of file and allocated bytes of file
968 $ print $(($(stat +block -- file) * 512 - $(stat +size -- file)))
971 # ``D'' : to include dot files (d lowercase is for device)
972 # ``O'' : reverse Ordered (o lowercase for non-reverse order)
973 # ``L'' : by file Length (l is for number of links)
974 # ``[1]'': return only first one
976 $ stat +size ./*(DOL[1])
980 $ stat -L +size ~/.zshrc
983 # Delete files in a directory that hasn't been accessed in the last ten days
984 # and send ONE mail to the owner of the files informing him/her of the files' deletion.
985 $ zmodload zsh/stat zsh/files
987 $ rm -f /path/**/*(.a+10e{'stat -sA u +uidr $REPLY; f[$u]="$f[$u]$REPLY"'})
988 $ for user (${(k)f}) {print -rn $f[$user]|mailx -s "..." $user}
990 # Get a "ls -l" on all the files in the tree that are younger than a specified age
992 $ for d (. ./**/*(N/m-2))
993 > print -r -- $'\n'$d: && cd $d && {
995 > stat -F '%b %d %H:%M' -LsAs -- $f &&
996 > print -r -- $s[3] ${(l:4:)s[4]} ${(l:8:)s[5]} \
997 > ${(l:8:)s[6]} ${(l:8:)s[8]} $s[10] $f ${s[14]:+-> $s[14]}
1001 # get file creation date
1003 $ stat -F '%d %m %Y' +mtime ~/.zshrc
1005 $ stat -F '%D' +mtime ~/.zshrc
1007 -------------------------------------------------------------------------------
1009 zsh/files (require zmodload zsh/files)
1010 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1011 -------------------------------------------------------------------------------
1012 # search a directory for files containing a certain string then copy those files to another directory.
1013 $ zmodload zsh/files
1015 $ cp $(grep -lZr foobar .) otherdirectory
1016 -------------------------------------------------------------------------------
1018 zsh/mapfile (require zmodload zsh/mapfile)
1019 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1020 -------------------------------------------------------------------------------
1021 # grepping for two patterns
1022 $ zmodload zsh/mapfile
1024 $ pattern2="bar foo"
1025 $ print -l ./**/*(DN.e{'z=$mapfile[$REPLY] && [[ $z = *$pattern1* && $z = *$pattern2* ]]'})
1026 # or a solution in combination with zsh/pcre
1027 $ zmodload -i zsh/mapfile zsh/pcre
1029 $ pattern2="bar foo"
1030 $ pcre_compile "(?s)(?=.*?$pattern1).*?$pattern2"
1032 $ print -l ./**/*(DN.e{'pcre_match $mapfile[$REPLY]'})
1034 # equivalent for ``less /etc/passwd | grep -v root''
1035 $ zmodload zsh/mapfile
1037 $ print -rl -- ${${=mapfile[/etc/passwd]}:#*root*}
1038 # or - for case insensitive
1039 $ setopt extendedglob
1040 $ print -rl -- ${${=mapfile[/etc/passwd]}:#*(#i)root*}
1042 # If a XML-file contains stuff like ``<TAGA/>'' and ``<TAGB/>'', number this empty tags
1043 # (ones ending in '/>') so if encountered in the same order, the preceeding tags would become
1044 # ``<TAGA/>1</TAGA>'' and ``<TAGB/>2</TAGB>''
1045 $ zmodload zsh/mapfile
1047 $ apfile[data.xml.new]=${(S)mapfile[data.xml]//\
1048 > (#im)<TAGA>*<\/TAGA>/<TAGA>$((++cnt))<\/TAGA>}
1050 # removing all files in users Maildir/new that contain ``filename="gone.src''
1051 $ zmodload zsh/{files,mapfile}
1052 $ rm -f /u1/??/*/Maildir/new/100*(.e{'[[ $mapfile[$REPLY] == *filename=\"gone.scr\"* ]]'})
1054 # Grep out the Title from a postscript file and append that value to the end of
1057 $ zmodload zsh/mapfile
1058 $ zmv '(*).ps' '$1-${${${mapfile[$f]##*%%Title: }%% *}//[^a-zA-Z0-9_]/}.ps'
1059 -------------------------------------------------------------------------------
1061 zsh/mathfunc (require zmodload zsh/mathfunc)
1062 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1063 -------------------------------------------------------------------------------
1064 $ zmodload zsh/mathfunc
1065 $ echo $(( sin(1/4.0)**2 + cos(1/4.0)**2 - 1 ))
1066 -1.1102230246251565e-16
1067 $ echo $(( pi = 4.0 * atan(1.0) ))
1069 $ echo $(( f = sin(0.3) ))
1071 $ print $((1e12 * rand48()))
1073 $ print $(( rand48(seed) ))
1075 -------------------------------------------------------------------------------
1077 zsh/termcap (require zmodload zsh/termcap)
1078 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1079 -------------------------------------------------------------------------------
1080 $ zmodload -ab zsh/termcap echotc
1081 $ GREEN=`echotc AF 2`
1082 $ YELLOW=`echotc AF 3`
1084 $ BRIGHTRED=`echotc md ; echotc AF 1`
1085 $ print -l ${GREEN}green ${YELLOW}yellow ${RED}red ${BRIGHTRED}brightred
1086 -------------------------------------------------------------------------------
1088 zsh/zpty (require zmodload zsh/zpty)
1089 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1090 -------------------------------------------------------------------------------
1094 # ``-r'': read the output of the command name.
1096 $ zpty -r PW z '*password:'
1097 # send the to command name the given strings as input
1099 $ zpty -r PW z '*password:'
1101 # The second form, with the -d option, is used to delete commands
1102 # previously started, by supplying a list of their names. If no names
1103 # are given, all commands are deleted. Deleting a command causes the HUP
1104 # signal to be sent to the corresponding process.
1106 -------------------------------------------------------------------------------
1108 zsh/net/socket (require zmodload zsh/net/socket)
1109 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1110 -------------------------------------------------------------------------------
1111 # ``-l'': open a socket listening on filename
1112 # ``-d'': argument will be taken as the target file descriptor for the
1114 # ``3'' : file descriptor. See ``A User's Guide to the Z-Shell''
1115 # (3.7.2: File descriptors)
1116 $ zmodload zsh/net/socket
1118 # ``-a'': accept an incoming connection to the socket
1120 $ zsocket -a -d 5 3 # accept a connection
1124 -------------------------------------------------------------------------------
1126 zsh/zftp (require zmodload zsh/zftp)
1127 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1128 -------------------------------------------------------------------------------
1129 $ autoload -U zfinit
1131 $ zfparams www.example.invalid myuserid mypassword
1134 $ zfls -l zshtips.html
1135 $ zfput zshtips.html
1136 $ zfls -l zshtips.html
1138 # Automatically transfer files using FTP with error checking
1139 $ autoload -U zfinit ; zfinit
1140 $ zftp open host.name.invalid user passwd || exit
1141 $ zftp get /remote/file > /local/file; r=$?
1142 $ zftp close && exit r
1144 # compress and ftp on the fly
1145 $ autoload -U zfinit ; zfinit
1146 $ zftp open host.name.invalid user password
1147 $ zftp get $file | bzip2 > ${file}.bz2
1151 $ autoload -U zfinit ; zfinit
1154 $ for file in `zfls` ; do
1159 # Upload all regular files in $HOME/foobar (recursive) that are newer than two hours
1160 # to ftp.foobar.invalid/path/to/upload
1161 $ autoload -U zfinit ; zfinit
1162 $ zfopen ftp.foobar.invalid/path/to/upload
1164 $ zfput -r **/*(.mh-2)
1167 # long list of files on a ftp
1168 $ autoload -U zfinit ; zfinit
1170 $ zfcd /some/remote/Dir
1171 $ cd /some/local/Dir
1172 # If the list.txt is located on the remote host, change to
1173 # zfget ${(f)"$(zftp get /path/to/remote/list.txt)"}
1174 $ zfget ${(f)"$(cat list.txt)"}
1176 -------------------------------------------------------------------------------
1178 zsh/zselect (require zmodload zsh/zselect)
1179 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1180 -------------------------------------------------------------------------------
1184 | $ stty -icanon min 0 time 50
1187 | $ case "$yesno" in
1192 $ zmodload zsh/zselect
1193 $ if zselect -t 500 -r 0 && read yesno && [ yes = "$yesno" ]; then
1198 ------------------------------------------------------------------------------
1204 *auto_cd* (allow one to change to a directory by entering it as a
1205 command). *auto_pushd* (automatically append dirs to the push/pop list)
1206 pushd_ignore_dups (and don't duplicate them).
1210 *no_hup* (don't send HUP signal to background jobs when exiting ZSH).
1211 *print_exit_value* (show a message with the exit code when a command
1212 returns with a non-zero exit code)
1216 *hist_verify* (let the user edit the command line after history
1217 expansion (e.g. !ls) instead of immediately running it) +
1218 Use the same history file for all sessions : +
1219 *setopt SHARE_HISTORY*
1223 *no_clobber* (or set -C; prevent '>' redirection from truncating
1224 the given file if it already exists)
1228 *correct* (automatically correct the spelling of commands).
1229 *correct_all* (automatically correct the spelling of each word on the
1230 command line) *dvorak* (dvorak layout)
1234 Mailpath: simple multiple mailpath:
1235 -----------------------------------------------------
1236 mailpath=($HOME/Mail/mbox'?new mail in mbox'
1237 $HOME/Mail/tux.u-strasbg'?new mail in tux'
1238 $HOME/Mail/lilo'?new mail in lilo'
1239 $HOME/Mail/ldap-fr'?new mail in ldap-fr')
1240 -----------------------------------------------------
1242 Mailpath: dynamic mailpath:
1243 -----------------------------------------------------
1245 for i in ~/Mail/Lists/*(.); do
1246 mailpath[$#mailpath+1]="${i}?You have new mail in ${i:t}."
1248 -----------------------------------------------------
1249 Avoid globbing on special commands:
1250 --------------------------------------------------------
1251 for com in alias expr find mattrib mcopy mdir mdel which;
1252 alias $com="noglob $com"
1253 --------------------------------------------------------
1255 For migrating your bashprompt to zsh use the script bash2zshprompt located in
1256 the zsh source distribution under 'Misc'.
1258 For migration from (t)csh to zsh use the c2z tool that converts csh
1259 aliases and environment and shell variables to zsh. It does this by running
1260 csh, and having csh report on aliases and variables. The script then converts
1261 these to zsh startup files. It has some issues and usage information that are
1262 documented at the top of this script.
1264 Here are functions to set the title and hardstatus of an *XTerm* or of *GNU
1265 Screen* to 'zsh' and the current directory, respectively, when the prompt is
1266 displayed, and to the command name and rest of the command line, respectively,
1267 when a command is executed:
1268 ------------------------------------------------------------------
1270 if [[ $TERM == "screen" ]]; then
1271 # Use these two for GNU Screen:
1272 print -nR $' 33k'$1$' 33'\
1273 print -nR $' 33]0;'$2$''
1274 elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
1275 # Use this one instead for XTerms:
1276 print -nR $' 33]0;'$*$''
1279 function precmd { title zsh "$PWD" }
1282 local -a cmd; cmd=(${(z)1})
1283 title $cmd[1]:t "$cmd[2,-1]"
1285 ------------------------------------------------------------------
1287 Put the following line into your ~/.screenrc to see this fancy hardstatus:
1288 -----------------------------------------
1289 caption always "%3n %t%? (%u)%?%?: %h%?"
1290 -----------------------------------------
1293 Special variables which are assigned:
1294 ------------------------------------------------------
1295 $LINENO $RANDOM $SECONDS $COLUMNS $HISTCHARS $UID
1296 $EUID $GID $EGID $USERNAME $fignore $mailpath $cdpath
1297 ------------------------------------------------------
1302 *http://www.zsh.org/[]*
1304 *http://sourceforge.net/projects/zsh/[]*
1305 Z shell page at sunsite.dk::
1306 *http://zsh.sunsite.dk/[]*
1307 Mailinglistarchive::
1308 *http://www.zsh.org/mla/[]*
1310 *http://www.zsh.org/FAQ/[]*
1312 *http://zsh.sunsite.dk/Guide/[]*
1314 *http://www.zshwiki.org/[]*
1315 Die Zsh als interaktive Shell::
1316 *http://cssun.rrze.uni-erlangen.de/~sipakale/zshreferat.html[]*
1317 A short introduction from BYU::
1318 *http://docs.cs.byu.edu/docs/zsh/index.php[]*
1320 *http://stchaz.free.fr/mouse.zsh[]*
1321 Shell Corner: Zsh Suite of "keeper" Functions::
1322 *http://www.unixreview.com/documents/s=9513/ur0501a/ur0501a.htm[]*
1323 The Z Shell (A Fan Page)::
1324 *http://www.princeton.edu/~kmccarty/zsh.html[]*
1325 Making the Transition to Zsh::
1326 *http://www.linux-mag.com/cgi-bin/printer.pl?issue=2002-05&article=power[]*
1327 Curtains up: introducing the Z shell::
1328 *http://www-128.ibm.com/developerworks/linux/library/l-z.html?dwzone=linux[]*
1329 Die Zsh-Liebhaber-Seite::
1330 *http://www.infodrom.north.de/~matthi/zsh/[]*
1331 ZSH-Liebhaberseite::
1332 *http://michael-prokop.at/computer/tools_zsh_liebhaber.html[]*
1333 ZSH-Seite von Michael Prokop::
1334 *http://www.michael-prokop.at/computer/tools_zsh.html[]*
1335 A Case for the Z Shell on *http://www.daemonnews.org/[]*::
1336 *http://ezine.daemonnews.org/199910/zsh.html[]*
1337 ZSH-Section from Dotfiles.com::
1338 *http://www.dotfiles.com/index.php3?app_id=4[]*
1339 Writing Zsh Completion Functions::
1340 *http://www.linux-mag.com/2002-07/power_01.html[]*
1341 ZSH Prompt introduction::
1342 *http://aperiodic.net/phil/prompt/[]*
1344 *http://www.adamspiers.org/computing/zsh/[]*
1345 Zzappers Best of ZSH Tips::
1346 *http://www.rayninfo.co.uk/tips/zshtips.html[]*
1347 Zsh Webpage by Christian Schneider::
1348 *http://strcat.de/zsh/[]*
1349 The zsh-lovers webpage::
1350 *http://grml.org/zsh/[]*
1352 *#zsh at irc.freenode.org*
1353 The Z shell reference-card (included in the zsh-lovers debian-package)::
1354 *http://zsh.sunsite.dk/Refcard/refcard.ps.gz[]*
1358 This manpage was written by Michael Prokop, Christian 'strcat'
1359 Schneider and Matthias Kopfermann. But many ideas have been taken from
1360 zsh-geeks e.g. from the zsh-mailinglists (zsh-users and zsh-workers),
1361 google, newsgroups and the zsh-Wiki. +
1362 Thanks for your cool and incredible tips. We learned much from you!
1364 In alphabetic order:
1365 -------------------------------------------------------------------------
1366 Andrew 'zefram' Main - http://www.fysh.org/~zefram/
1367 Barton E. Schaefer - http://www.well.com/user/barts/
1368 Matthias Kopfermann - http://www.infodrom.north.de/~matthi/
1369 Oliver Kiddle - http://people.freenet.de/opk/
1370 Paul Falstad - http://www.falstad.com/
1371 Peter Stephenson - http://python.swan.ac.uk/~pypeters/
1373 Stephane Chazelas - http://stephane.chazelas.free.fr/
1374 Sven Guckes - http://www.guckes.net/
1375 Sven Wischnowsky - http://w9y.de/zsh/zshrc
1376 -------------------------------------------------------------------------
1381 ------------------------------------------------------------------
1382 zsh Zsh overview (this section)
1383 zshmisc Anything not fitting into the other sections
1384 zshexpn Zsh command and parameter expansion
1385 zshparam Zsh parameters
1386 zshoptions Zsh options
1387 zshbuiltins Zsh built-in functions
1388 zshzle Zsh command line editing
1389 zshcompwid Zsh completion widgets
1390 zshcompsys Zsh completion system
1391 zshcompctl Zsh completion control
1392 zshmodules Zsh loadable modules
1393 zshzftpsys Zsh built-in FTP client
1394 zshall Meta-man page containing all of the above
1395 ------------------------------------------------------------------
1397 Note: especially 'man zshcontrib' covers very useful topics! +
1398 Book: *From Bash to Z Shell* by Oliver Kiddle, Jerry Peck and Peter
1399 Stephenson. *ISBN: 1590593766*. +
1400 Also take a look at the section *LINKS* in this manpage.
1404 Probably. This manpage might be never complete. So please report bugs,
1405 feedback and suggestions to <zsh-lovers@michael-prokop.at>. Thank
1410 Copyright \(C) Michael Prokop, Christian Schneider and Matthias