I was playing around a bit with the names of some executables, putting them in a folder,
~/bin, which is in my
$PATH. Now I'm wondering how I can set the preferences of a
bash-3.2 terminal so that it picks up these executables instead of the builtins or aliases to execute.
For example, if I put a script named
cd in a directory in
$PATH, the builtin for
cd is still executed. However, if I create an
cd, then this alias will be executed, overriding the builtin.
$ type cd cd is a shell builtin
Is there a way to make an executable file in
$PATHhave, by default, preference over a shell builtin, by executing only, e.g.
cdwithout having to resort to using the commands
I'm also interested in any official reference which discusses this preference (not the reasoning, that I do understand).
Note: This question is purely for personal educational purposes, I am wondering why it works the way it works.