CMD
Platform Ops Glossary Linux Commands
Fundamentals, Kernel & Shell · Term #7

Linux Commands

The executable programs (ls, cp, grep...) that make up the day-to-day vocabulary of the CLI.

Category
Fundamentals, Kernel & Shell
Complexity
Beginner
Glossary Entry
#7 of 190
ShellPATHPackage ManagementShellPATHPackage Management
What Is It

The Short Answer

A "Linux command" is really one of two different things wearing the same hat: a shell builtin (implemented inside the shell itself — cd, echo, export) or an external command (a separate executable file somewhere on disk — ls, grep, python3). You can't tell which is which just by typing it.

This distinction matters more than it seems: builtins run without forking a new process (faster, and able to change the shell's own state — cd has to be a builtin, since a child process changing its own directory can't affect its parent shell).

How It Works

Under The Hood

When you type an external command, the shell searches every directory listed in $PATH, in order, until it finds an executable file with that name — then forks a child process and execs that file. The first match wins, which is exactly how you can accidentally run the wrong version of a tool if an older copy sits earlier in PATH.

The shell actually caches where it found commands (a hash table) for speed, which is why installing a new binary sometimes requires hash -r or a fresh shell before the shell will notice it.

In Practice

Example Commands

figure out what you're actually running
type ls
# tells you builtin, alias, function, or the file path
which python3
# first match in PATH — external commands only
echo $PATH
Watch Out For

Common Mistakes

⚠️Assuming which works for shell builtins — it only searches PATH, so which cd returns nothing useful; use type instead.
⚠️Installing a tool but running the wrong version because an older copy earlier in PATH shadows it — check with type -a toolname to see every match.
VA
Vishal Abhinav
Platform Ops Engineer · Linux & Unix Glossary