I don't have many aliases set up in my .bash_aliases file just yet. Only recently have I discovered how useful they can be.
I can see myself getting quite hooked on aliases so before the file gets too unwieldy I'd like to clarify something by asking a very simple question. Does one alias affect another, or does the alias always revert back to the original command?
An example may make this more clear:
I have ls
aliased to ls -lF
. Let's say I'd like to also alias d
to ls -l | grep -E "^d"
: does d
now use ls -lF
in place of ls
? If so, is it a matter of order in the .bash_aliases configuration file?
man alias
didn't enlighten me.
Best Answer
From Aliases (section 6.6 of the Bash Manual):
This happens when you use the alias, not when you define it. Here's an example: