Skip to content
EntityQ285142· pop 19· linked from 215 articles

Also known as unalias

command in various command line interpreters

Described at

The alias utility shall create or redefine alias definitions or write the values of existing alias definitions to standard output. An alias definition provides a string value that shall replace a command name when it is encountered; see Alias Substitution . An alias definition shall affect the current shell execution environment and the execution environments of the subshells of the current shell. When used as specified by this volume of POSIX.1-2017, the alias definition shall not affect the parent process of the current shell nor any utility environment invoked by the shell; see Shell Execution Environment . Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( One of the name operands specified did not have an alias definition, or an error occurred. The alias description is based on historical KornShell implementations. Known differences exist between that and the C shell. The KornShell version was adopted to be consistent with all the other KornShell features in this volume of POSIX.1-2017, such as command line editing. Since alias affects the current shell execution environment, it is generally provided as a shell regular built-in. Historical versions of the KornShell had not written aliases in a quoted manner suitable for reentry to the shell, but this volume of POSIX.1-2017 has made this a requirement for all similar output. Therefore, consistency was chosen over this detail of historical practice. This utility is marked as part of the User Portability Utilities option. The alias utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an option for interactive utilities.

Excerpt from a page describing this subject · 7,781 chars · not written by Vinony

Article · 中文

在中,alias 是许多命令行界面的命令,比如 Unix shell,/ 和 Windows PowerShell 等,它给用户提供了别名——也就是用自定义字符串替换指定命令的功能,通常用于简写系统命令,或给常用命令添加默认选项,MS-DOS 和 Microsoft Windows 操作系统內,通常使用 DOSKey 命令定义别名。 alias 命令的作用时间是命令运行之后到 shell 会话结束,经常使用的别名可在 shell 的配置文件比如 C Shell(csh)的 ~/.cshrc 或 Bourne Again Shell 的 ~/.bashrc 里定义,如此当相应的 shell 会话启动后就可以使用这些自定义的别名了。alias 命令可以直接写入这些配置文件,或单独放在一个文件,比如 .alias 里,或依用户使用的解释器分别定义于 .alias-bash,.alias-csh 等文件,然后使用 source 命令执行该文件来设定。

Abstract from DBpedia / Wikipedia · CC BY-SA