DEV Community

Discussion on: Reveal the command behind an alias with ZSH

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

Thanks. Didn't know about the hook or other options.

For manually check, I usually use which, or type.

$ which ll 
ll is aliased to ls -l
Enter fullscreen mode Exit fullscreen mode

I also like to use my ag alias. To find an alias based on a key or value.

github.com/MichaelCurrin/dotfiles/...

e.g. find all aliases using ls.

$ ag ls
alias ll="ls -l -h"
alias l1="ls -1"
...
Enter fullscreen mode Exit fullscreen mode

Or I could find one by key.

ag ll
Enter fullscreen mode Exit fullscreen mode