Alias (command)

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

Example of a combination of the Unix ps command and grep with the bash shell could be the alias psg. The aim of the new command is psg the output of a specific process on the screen. In the following example, information about the syslog daemon to be output. By calling the Unix shell commands alias all known aliases are displayed in the terminal. Should the new command will be deleted, so the function is used unalias.

Host: ~ A $ alias psg = ' ps- ax | grep -v grep | grep' host: ~ A $ psg syslog    35? Ss 0:00:26 / usr / sbin / syslogd host: ~ A $ alias alias psg = ' ps- ax | grep -v grep | grep' host: ~ A $ unalias psg The aliases defined can be saved in the startup files on the user profile.

Often aliases with the Unix command ls used. A popular example is l or ll, a alias for ls- l, indicative of a more verbose output with the permissions of all files in a specific directory. However, HP- UX, this command is a binary file.

48016
de