List all aliases available in fish/bash shell

Labithiotis picture Labithiotis · Oct 9, 2016 · Viewed 13.2k times · Source

Is there a way to list all aliases, something like:

$ ls-aliases
.. "cd .."
la "ls -Gla"
gs "git stash"
etc...

Also is it possible to add human readable descriptions to aliases ?

I'm on a MacOSX

Answer

heemayl picture heemayl · Oct 9, 2016

In bash:

To list all aliases:

alias

To add a comment, just put it at the end of the command, e.g.:

$ alias foo='echo bar #some description'

$ foo
bar

$ alias foo
alias foo='echo bar #some description'