Monday, April 11, 2016

How to see the command attached to a bash alias?

How to see the command attached to a bash alias?

Ctrl + Alt + E as I learned from this answer. It "expands" the currently typed command line, meaning it performs alias expansion (among other things).

# ls (Ctrl + Alt + E)

ls --color=auto

Or

# type ls

ls is aliased to `ls --color=auto'

Or

# alias ls

alias ls='ls --color=auto'

Or

# alias

alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias g='grep -riI --exclude="*\.svn*"'
alias gc='git commit -a -m "up"'
alias gg='grep -rI --exclude="*\.svn*"'
alias gp='git push'
alias gpp='git pull'
alias grep='grep --color=auto'
alias gs='git status'
alias h='history'
alias l.='ls -d .* --color=auto'
alias ll='ls -la'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'

Reference:

http://askubuntu.com/questions/102093/how-to-see-the-command-attached-to-a-bash-alias

http://stackoverflow.com/questions/211378/hidden-features-of-bash/1416125#1416125

No comments: