When you type a command into the shell, it has to find the program on your hard disk before executing it. If the shell had to look all over the disk, it would be very slow; instead, it looks in a list of directories contained in the PATH environment variable. This list of directories makes up the shell's search path; when you enter a command, it goes through each one in turn looking for the program you asked to run.
You may need to change the PATH variable if you install programs yourself in a non-standard location. The value of PATH is a colon-separated list of directories. The default value on Debian systems is as follows:
You can see which ls the shell is going to use with the type command. type ls will give you the answer /bin/ls. Try it yourself.
Try asking where type itself resides:
type is a shell builtin
There are a number of commands like this; type man builtins to read the man page describing them. In general, you don't need to know whether a command is a builtin or a real program; however, builtins will not show up in the output of ps or top because they aren't separate processes. They're just part of the shell.
John Goerzen / Ossama Othman