Datasheet
searching for a file with the same name in a given set of directories. The directories to search are stored
in a shell variable,
PATH, in much the same way as with Windows. The search path (to which you can
add) is configured by your system administrator and will usually contain some standard places where
system programs are stored. These include:
❑
/bin: Binaries, programs used in booting the system
❑
/usr/bin: User binaries, standard programs available to users
❑
/usr/local/bin: Local binaries, programs specific to an installation
An administrator’s login, such as
root, may use a PATH variable that includes directories where system
administration programs are kept, such as
/sbin and /usr/sbin.
Optional operating system components and third-party applications may be installed in subdirectories
of
/opt, and installation programs might add to your PATH variable by way of user install scripts.
Note that Linux, like UNIX, uses the colon (
:) character to separate entries in the PATH variable, rather
than the semicolon (
;) that MS-DOS and Windows use. (UNIX chose : first, so ask Microsoft why
Windows is different, not why UNIX is different!) Here’s a sample
PATH variable:
/usr/local/bin:/bin:/usr/bin:.:/home/neil/bin:/usr/X11R6/bin
Here the PATH variable contains entries for the standard program locations, the current directory (.), a
user’s home directory, and the X Window System.
Text Editors
To write and enter the code examples in the book, you’ll need to use an editor. There are many to choose
from on a typical Linux system. The vi editor is popular with many users.
Both of the authors like Emacs, so we suggest you take the time to learn some of the features of this
powerful editor. Almost all Linux distributions have Emacs as an optional package you can install, or
you can get it from the GNU website at
http://www.gnu.org or a version for graphical environments
at the XEmacs site at
http://www.xemacs.org.
To learn more about Emacs, you can use its online tutorial. To do this, start the editor by running the
emacs command, and then type Ctrl+H followed by t for the tutorial. Emacs also has its entire manual
available. When in Emacs, type Ctrl+H and then i for information. Some versions of Emacs may have
menus that you can use to access the manual and tutorial.
Remember, Linux uses a forward slash (/) to separate directory names in a filename
rather than the backslash (\) of Windows. Again, UNIX got there first.
It’s not a good idea to delete directories from PATH unless you are sure that you
understand what will result if you do.
6
Chapter 1: Getting Started
47627c01.qxd:WroxPro 9/28/07 8:56 PM Page 6