myprocs that runs the command ps -fu
$LOGNAME
zsh goes beyond this definition as you'll see below. It has a very flexible and powerful system for defining, using, and manipulating aliases.
alias builtin is:
alias [ -gmrL ] [ name[=value] ... ]
The -r argument tells the alias command to
operate on regular aliases. The -g
argument tells the alias command to operate on
global aliases. (See below) Without either the
r or g flags, alias operates on
both types.
For each name with no value, zsh will print the name and what it is
aliased to. With no arguments at all, alias prints the
values of ALL defined aliases
With the -L argument, the output from alias
is suitable to cut-and-paste into your startup scripts. (Try it out)
To define one or more aliases, simply enter
alias name1=value1
name2=value2
...
nameX=valueX
For each name with a corresponding value, zsh defines an alias with that value.
For example, let's say that you do a lot with (to) your .procmailrc
file. You run a lot of utilities on it, like emacs,
cp, less, etc. You don't want to define an alias
for EACH command you run on it. That would involve doing something like:
alias wprc="wc -l ~/.procmailrc" alias cprc="cp ~/.procmailrc ~/.procmailrc.safe" alias eprc="emacs ~/.procmailrc"
Instead, you can use a global alias for the file. To define a global
alias, use the -g argument to the alias
command.
alias -g prc=~/.procmailrc
Now, you can easily refer to your .procmailrc file from anywhere on the command line:
lyric > emacs -nw prc
Look here if you are interested in another, less powerful way to do global aliasing.
pattern. You do
this with the -m argument to the alias
command. pattern is specified exactly like filename
generation patterns. In fact, you'll need to put single quotes around
pattern to keep zsh from treating it as a filename pattern.
foo entirely by typing:
unalias foo
You can temporarily disable an alias foo
by running: disable -a foo
You can turn it back on with: enable -a foo
Finally, you may have an alias such as ftp that actually
runs a different program, such as ncftp. If you'd like to
use the actual ftp program, use =ftp or
\ftp on the command line.