bash: alias

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Find out what an alias stands for:

$ alias ll
alias ll='ls -lh --color=always'

Use type to see where a command is defined:

$ type ll
ll is aliased to `ls -lh --color=always'
$ type vim
vim is /usr/bin/vim

combine the output of 'alias' to 'grep' to find out all the 'ls' aliases:

$ alias | grep ls
alias la='ls -A --color=always'
alias ll='ls -lh --color=always'
alias lla='ls -lha'
alias ls='ls --color=auto'

If you need to debug some unexpected alias and you want to know where it was set, there is no easy way.
The best way is to launch bash in verbose mode:

$ bash --verbose

It will output the content of all the files it sources. There is no easy way to grep the output.
In such situations, it would be nice to have the following:
- a simple list of files that bash sources upon start up.
- a precise indication of which file, which line a specific alias was set.

Issues related to this page:

ProjectSummaryStatusPriorityCategoryLast updatedAssigned to
Linux softwareFind out where alias was setactivenormalfeature request7 years 48 weeks