Hash tables and PATH is not the first method locating your program / executable files. Your program can be a shell function or builtin command or an alias. Here is the complete sequence adopted by BASH shell to execute your command:

  1. Before a command is executed REDIRECTION is done. Then following sequence used by SHELL
  2. ALIASES
  3. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
  4. Shell FUNCTION
  5. BUILTIN command
  6. HASH tables
  7. PATH variable
  8. If everything fails, you see command not found error message.

hence from above, the bash can not make entries of aliases, shell functions and builtin commands in hash table.

Following is the command to see entered command is alias or function or builtin command or command path is in hash table.:

[root@plowitech ~]# type cd
cd is a shell builtin

[root@plowitech ~]# type ll
ll is aliased to `ls -l –color=auto’

[root@plowitech ~]# type hello
hello is a function

[root@plowitech ~]# type clear
clear is /usr/bin/clear