Print terminal alias command as well as executing it

bash, terminal

Solution

You can always use:

- `alias` to list all your aliases, or

- `alias name` to show the specification of the alias `name`.

So in fact you can define your alias as

alias myalias="alias myalias; <do stuff>"

I also think that chepner's answer with Alt-Control-e is more practical, but I am posting this for completeness.

Problem

As a terminal noob, I've created aliases for pretty much everything I do. The problem is that I've started forgetting those few commands that I do know because of it. On top of that, I sometimes need to edit a variable in the previous command. So what I'd like is if when I use an alias, the first line printed is the actual command it represents, then proceed to execute the command. Since pressing up and `!!` simply reprints the alias, I'm not too sure how to get a reference to the underlying command. Thanks.

Original source