I can use compgen -a
to list all the aliases:
$ compgen -a
egrep
fgrep
grep
l
la
ll
ls
l
, la
and ll
are defined in my ~/.bashrc
:
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
What command can I run to see what an alias expands to? I have found the whatis
, whereis
and which
, but they don't do what I want.
type
which you can use on any command. If your command is an alias or function,type
tells you the definition; if it's an executable, you get the path; if it's superseeded by a shell built-in, it will tell you so. Available in bourne shell and successors.alias
without arguments, you'll getlist of aliases in the reusable form 'alias NAME=VALUE' on standard output