| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Zsh Manual, like the shell itself, is large and often complicated. This section of the manual provides some pointers to areas of the shell that are likely to be of particular interest to new users, and indicates where in the rest of the manual the documentation is to be found.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When it starts, the shell reads commands from various files. These can be created or edited to customize the shell. See 5. Files.
If no personal intialization files exist for the current user, a function is run to help you change some of the most common settings. It won't appear if your administrator has disabled the zsh/newuser module. The function is designed to be self-explanatory. You can run it by hand with `autoload -Uz zsh-newuser-install; zsh-newuser-install -f'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Interaction with the shell uses the builtin Zsh Line Editor, ZLE. This is described in detail in 18. Zsh Line Editor.
The first decision a user must make is whether to use the Emacs or Vi editing mode as the keys for editing are substantially different. Emacs editing mode is probably more natural for beginners and can be selected explicitly with the command bindkey -e.
A history mechanism for retrieving previously typed lines (most simply with the Up or Down arrow keys) is available; note that, unlike other shells, zsh will not save these lines when the shell exits unless you set appropriate variables, and the number of history lines retained by default is quite small (30 lines). See the description of the shell variables (referred to in the documentation as parameters) HISTFILE, HISTSIZE and SAVEHIST in 15.6 Parameters Used By The Shell.
The line editor provides an extensive completion system and the shell is supplied with completions for many commonly used commands. Note that the new completion system referred to as compsys is preferred over the older compctl system. The completion system must be enabled explicitly when the shell starts. For more information see 20. Completion System.
Apart from completion, the line editor is highly extensible by means of shell functions. Some useful functions are provided with the shell; they provide facilities such as:
See 25.4 ZLE Functions for descriptions of these.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The shell has a large number of options for changing its behaviour. These cover all aspects of the shell; browsing the full documentation is the only good way to become acquainted with the many possibilities. See 16. Options.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The shell has a rich set of patterns which are available for file matching (described in the documentation as `filename generation' and also known for historical reasons as `globbing') and for use when programming. These are described in 14.8 Filename Generation.
Of particular interest are the following patterns that are not commonly supported by other systems of pattern matching:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Although the syntax of zsh is in ways similar to the Korn shell, and therefore more remotely to the original UNIX shell, the Bourne shell, its default behaviour does not entirely correspond to those shells. General shell syntax is introduced in 6. Shell Grammar.
One commonly encountered difference is that variables substituted onto the command line are not split into words. See the description of the shell option SH_WORD_SPLIT in 14.3 Parameter Expansion. In zsh, you can either explicitly request the splitting (e.g. ${=foo}) or use an array when you want a variable to expand to more than one word. See 15.2 Array Parameters.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The most convenient way of adding enhancements to the shell is typically by writing a shell function and arranging for it to be autoloaded. Functions are described in 9. Functions. Users changing from the C shell and its relatives should notice that aliases are less used in zsh as they don't perform argument substitution, only simple text replacement.
A few general functions, other than those for the line editor described above, are provided with the shell and are described in 25. User Contributions. Features include:
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |