Reputation: 703
How to list all aliases defined in a shell?
Like the command below to list all files/folders in a directory.
I have defined some aliases in ~/.bashrc
that I want to list.
ls in a directory
Upvotes: 64
Views: 89979
Reputation: 1956
Are you wondering if you have a UNIX alias already set for a specific command?
You can find it easily by issuing this on the command line:
alias
This command will list all aliases currently set for your shell session.
Upvotes: 111
Reputation: 71
You can use the compgen
command as follows:
compgen -a
compgen
empowers you to list all your defined aliases, functions and commands.Another option would be alias
command itself.
alias
Upvotes: 3
Reputation: 647
Just type alias
in terminal?
This should give you all active aliases.
For example:
$alias
alias ..='cd ..'
alias ...='cd ../..'
alias ga='git add'
alias gc='git commit'
alias gitlg='git log --graph --pretty=format:'\''%Cred%h%Creset -
%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-
commit'
alias gs='git st'
alias ll='ls -l'
alias ls='ls -F --color=auto --show-control-chars'
Upvotes: 15