/usr/bin and Other Software Directories
The Challenges of Software Installation on Unix
Which make?
Simplifying the make Process
Using Debian's dselect
Installing Software with Debian's Apt-Get
Interruptable gets with wget
The curl Application and One-Step GNU-Darwin Auto-Installer for OS X
Installation with FreeBSD Ports
Installing with FreeBSD Packages
Finding and Installing RPM Packaged Software
The location for certain types of installed files is very important. For instance, on many Unix systems, binary files accessible by users are located in the subdirectory /usr/bin or /usr/local/bin. If the applications aren't in these places, they may not be in the PATH environment variable and not easily accessible from the command line.
On my FreeBSD system, I've installed a utility called dos2unix, a file-formatting application that converts DOS newline character combinations to the Unix newline character. I used the FreeBSD Ports system to install the application, which automatically placed the program in my application directory, in my case /usr/local/bin. When I want to execute the application, I can run it from the command line without having to provide the location of the file:
dos2unix some.txt > new.txt
This command reformats the newline character of the contents of some.txt, converting DOS linebreaks to Unix ones.
The /usr/bin subdirectory differs from the /bin directory located directly off of the main root directory. The /bin directory has basic installed binaries built into the Unix operating system, with commands such as cd to change directory and so on. When you install an optional software application, it should not install software in the top-level binary subdirectory, but in /usr/bin, instead.
According to the Filesystem Hierarchy Standard (FHS), subdirectories (Linux- and BSD-specific) shown in Table 40-1 are located directly off the root directory within a standardized directory hierarchy.
Subdirectory |
Contents |
---|---|
Application binaries |
|
Boot loader static files |
|
Device files |
|
System configuration files |
|
Shared libraries and kernel modules |
|
Temporary mounting point for filesystems such as CD-ROMs |
|
Larger static software packages |
|
System binaries |
|
Temporary files |
|
User hierarchy, which has its own subdirectory with the following entries:
|
|
Variable data |
If you install an application and the binaries aren't placed into the bin directory, you'll need to add the binary location to your PATH environment variable to access the application from the command line.
NOTE: For more information about FHS, see the home page at http://www.pathname.com/fhs/. Many Unix systems support this hierarchy, including the BSD systems such as FreeBSD and NetBSD, as well as Red Hat Linux and others. However, your own Unix admin may adjust this hierarchy to fit the needs of your enterprise, so you'll want to check subdirectory locations before proceeding with manual software installation.
-- SP
Copyright © 2003 O'Reilly & Associates. All rights reserved.