shell alias
A short name the shell swaps in for the start of a command line, defined with alias name='command'.
In more detail
Only the first word of a line is replaced, and only in interactive shells, so aliases do nothing in scripts; use a function there. alias with no arguments lists them and unalias removes one. Keep the ones you want in your .bashrc file.
Examples
alias ll='ls -la'alias cp='cp -i'Related terms
- shell function — A named group of commands, defined as name() { ...; }, that you then run like any other command.
- .bashrc — A file in your home directory that every new interactive bash reads at startup, used for aliases, functions and prompt settings.
- interactive shell — A shell reading commands from you at a terminal, as opposed to a non-interactive shell running a script.
Taught in
- Making, Copying, Moving And Removing — Bash Scripting & Command Line Automation
- Help, History, Completion And Aliases — Bash Scripting & Command Line Automation