Skip to Content
Running Linux, Third Edition
book

Running Linux, Third Edition

by Matthias Kalle Dalheimer, Lar Kaufman, Matt Welsh
August 1999
Beginner
760 pages
23h 55m
English
O'Reilly Media, Inc.
Content preview from Running Linux, Third Edition

What Is a Command?

We’ve said that Unix offers a huge number of commands and that you can add new ones. This makes it radically different from most operating systems, which contain a strictly limited table of commands. So what are Unix commands, and how are they stored? On Unix, a command is simply a file. For instance, the ls command is a binary file located in the directory bin. So, instead of ls, you could enter the full pathname, also known as the absolute pathname:

$ /bin/ls

This makes Unix very flexible and powerful. To provide a new utility, a system administrator can simply install it in a standard directory where commands are located. There can also be different versions of a command—for instance, you can offer a new version of a utility for testing in one place while leaving the old version in another place, and users can choose the one they want.

Here’s a common problem: sometimes you enter a command that you expect to be on the system, but you receive a message such as “Not found.” The problem may be that the command is located in a directory that your shell is not searching. The list of directories where your shell looks for commands is called your path. Enter the following to see what your path is (remember the dollar sign!):

$ echo $PATH 
/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/lib/java/bin:\
/usr/games:/usr/bin/TeX:.

This takes a little careful eyeballing. The output is a series of pathnames separated by colons. The first pathname, for this particular ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Running Linux, 5th Edition

Running Linux, 5th Edition

Matthias Kalle Dalheimer, Matt Welsh
Linux Under the Hood

Linux Under the Hood

Sander van Vugt

Publisher Resources

ISBN: 156592469XCatalog PageErrata