LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

alias

Create shorthand names for commands

TLDR

List all aliases
$ alias
copy
Create a simple alias
$ alias [ll]='ls -la'
copy
Create alias with arguments
$ alias [grep]='grep --color=auto'
copy
Remove an alias
$ unalias [ll]
copy
Create persistent alias (add to ~/.bashrc or ~/.zshrc)
$ echo "alias ll='ls -la'" >> ~/.bashrc
copy

SYNOPSIS

alias [name[=value]...]

DESCRIPTION

alias is a shell builtin that creates shorthand names for commands or command sequences. When you type an alias name, the shell substitutes the associated value before execution.Aliases are useful for creating shortcuts for frequently used commands with specific options, reducing typing and preventing repetitive mistakes.

PARAMETERS

Without arguments, alias displays all defined aliases. With name, it shows that alias's definition. With name=value, it creates or updates an alias.

PERSISTENT ALIASES

To make aliases permanent, add them to your shell configuration.Bash

~/.bashrc or ~/.bash_aliases
Zsh
~/.zshrc or ~/.zsh_aliases
Fish
Use alias --save or edit ~/.config/fish/config.fish

CAVEATS

Aliases are not expanded in shell scripts by default. They don't accept arguments in the middle of the expansion (use functions for that). Aliases are shell-specific and must be defined in the shell's configuration file for persistence.

HISTORY

The alias command has been a feature of Unix shells since the C shell (csh) in the late 1970s. It was adopted by Bash, Zsh, and most other modern shells with similar syntax.

SEE ALSO

unalias(1), type(1), function(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid