alias_command

alias (command)

Snippet from Wikipedia: Alias (command)

alias is shell command that defines a word that the shell replaces with associated text before interpreting a command line. It is often used to enhance productivity by abbreviating a command or for including commonly-used arguments with a command. The command is available in Unix shells, AmigaDOS, 4DOS/4NT, FreeDOS, KolibriOS, PowerShell, ReactOS, EFI shell, and IBM i. Aliasing functionality in MS-DOS and Command Prompt is provided by the DOSKEY command.

Since aliases are defined only for a shell session, regularly-used aliases are often defined in a session startup shell script such as .bashrc. The alias commands may either be written in the config script directly or sourced from a separate file.

Aliases were introduced in the C shell to survive in descendant shells such as tcsh and bash. As these aliases were limited to one line they were useful for creating relatively simple shortcut commands, but not more complex constructs. Older versions of the Bourne shell did not offer aliases, but did provide functions, which are more powerful than the csh alias. Eventually, the csh alias was implemented in the bash and ksh shells. With shells that support both functions and aliases but no parameterized inline shell scripts, the use of functions wherever possible is recommended. None-the-less, aliases are necessary where chained aliases are required.

alias_command.txt · Last modified: 2025/02/01 07:22 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki