You can run a program without its full pathname because of your command “search path.”

So how do you get from typing /bin/date on the command line to only typing date?

When you type the word date on the command line, the computer looks through the system for a command by that name. It doesn’t look everywhere. Instead, the computer searches for the command only in those directories listed in your search path. If your search path contains the directories /usr/bin, /usr/ucb, /bin, and /usr/local/bin, the computer first looks for /usr/bin/date. If it doesn’t find the date program in /usr/bin, then it looks for /usr/ucb/date. And so on, until it finds /bin/date.

Once UNIX finds a program by the name date in a directory in your search path, it executes that program.

Get WYNTK: UNIX System Admininistrator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.