HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

alias — Create aliases - words that are replaced by a command string. Aliases expire with the current shell

Submitted by: @import:tldr-pages··
0
Viewed 0 times
createcommandareclialiaseswordsaliasthat

Problem

How to use the alias command: Create aliases - words that are replaced by a command string. Aliases expire with the current shell session unless defined in the shell's configuration file, e.g. ~/.bashrc for Bash or ~/.zshrc for Zsh. See also: unalias. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-alias>.

Solution

alias — Create aliases - words that are replaced by a command string. Aliases expire with the current shell session unless defined in the shell's configuration file, e.g. ~/.bashrc for Bash or ~/.zshrc for Zsh. See also: unalias. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-alias>.

List all aliases:
alias


Create a generic alias:
alias {{word}}="{{command}}"


View the command associated to a given alias:
alias {{word}}


Remove an aliased command:
unalias {{word}}


Turn rm into an interactive command:
alias {{rm}}="{{rm --interactive}}"


Create la as a shortcut for ls --all:
alias {{la}}="{{ls --all}}"

Code Snippets

List all aliases

alias

Create a generic alias

alias {{word}}="{{command}}"

View the command associated to a given alias

alias {{word}}

Remove an aliased command

unalias {{word}}

Turn `rm` into an interactive command

alias {{rm}}="{{rm --interactive}}"

Context

tldr-pages: common/alias

Revisions (0)

No revisions yet.