Interview Prep/Linux/Filesystem Hierarchy, Inodes & Links

How does Linux find a command when you type it?

BeginnerConceptFilesystem Hierarchy, Inodes & Links
Answer

The shell checks, in order: aliases, shell functions, builtins, then each directory in $PATH from left to right, caching results in a hash table.

type -a ls
command -v kubectl
echo $PATH
hash -r        # clear the cache after moving a binary
All Linux questions Roadmap: Linux

More on Filesystem Hierarchy, Inodes & Links