alias

bash: alias

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.

Find out where alias was set

If I do:
$ alias my_aliased_command
I can find out which command the alias stands for.
e.g.

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

Is there a way to discover we might have set up on our system but forgotten (or simply didn't know about)?

I'd like to be able to do:

$ alias --reverse ls
alias la='ls -A --color=always'
alias lla='ls -lha'
alias ll='ls -lh --color=always'

No manual entry for alias

$ man alias
No manual entry for alias

=> There should be one.

Syndicate content