alias (Unix)

from Wikipedia, the free encyclopedia

An alias is a function of a Unix shell with which several Unix commands or a Unix command with several options can be replaced by a new command. It is used to save time and type less.

The alias could be an example of a combination of the Unix commands psand grepthe Bash shell psg. The aim of the new command psgis to output a specific process on the screen. In the following example information should about the daemon by syslog output. By calling the Unix shell command alias, all known aliases are displayed in the terminal . The function is unaliasused if the new command is to be deleted again .

$ alias psg='ps -ax | grep -v grep | grep'
$ psg syslog
  35  ??  Ss     0:00.26 /usr/sbin/syslogd
$ alias
alias psg='ps -ax | grep -v grep | grep'
$ unalias psg

The defined aliases can be saved in the start files of the user profile .

Often aliases are used with the Unix command ls . A popular example is lor ll, an alias for ls -l, which shows more detailed output showing the permissions for all files in a particular directory. However, on HP-UX , this command is a binary file .

Web links