myprocsthat 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 [ -gmrL ] [ name[=value] ... ]
-r argument tells the
alias command to
operate on regular aliases. The
argument tells the
alias command to operate on
global aliases. (See below) Without either the
alias operates on
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
-L argument, the output from
is suitable to cut-and-paste into your startup scripts. (Try it out)
To define one or more aliases, simply enter
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
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 -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
-margument to the
patternis specified exactly like filename generation patterns. In fact, you'll need to put single quotes around
patternto keep zsh from treating it as a filename pattern.
fooentirely by typing:
You can temporarily disable an alias
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 on the command line.