Hi, bash by default searchs in paths specified in the environment variable PATH (separated by ":"). I'm not aware if there is any cache mechanism to save the run time (but even so, different terminals still can not see the same cache, hence each terminal has the overhead to create the cache). When there are many files in PATH, it is going to slow down the performance.
One simple remedy is to instead search in a file where the abspaths of all the commands are saved (of course, this database file can be generated by using the command 'find' to search for all the directories in $PATH, which process can be scheduled to run periodically using cron). To make this work, I'm wondering if there is an easy way to customize the way that bash resolve a command. -- Regards, Peng