I have read that the shell searches the command in all the directories available in the PATH variable. My first question is what if 2 directories have the files for a command, which one will be executed ?  Second question is, does the shell searches in the directories shown in PATH variable recursively or not ?Thanks.
if 2 commands with same filename exists in PATH variable, which will get executed?
shell;path