Chapter 2. AIX Toolbox for Linux Applications 29
info GNU information systems primary directory.
lib Contains shared libraries used by the Toolbox applications. It
also contains object libraries, compiler program binaries, and
other libraries.
doc Contains miscellaneous documentation.
include Contains include files for the Toolbox.
libexec Contains support programs and libraries for a particular set of
programs that are not meant to be executed or linked directly by
other applications.
share Contains architecture-independent files, such as timezone and
terminfo information.
man Manual pages are organized into user programs (man1), library
functions and subroutines (man3), file formats (man5), and
system administration pages (man8).
src/packages The packages source directory is organized into binary RPM
packages (RPMS), source RPM packages (SRPMS), source
code and usually zipped TAR packages (SOURCES), RPM
specification files (SPECS), and the directory where the building
of RPM packages is done by the rpm command (BUILD). Please
refer to Chapter 3, Porting Open Source Software to AIX on
page 57.
2.2.5 How to enable the use of the Toolbox commands
To execute the Linux version of the command (the Toolbox version) after it is
installed, you can either:
򐂰 Call it with its relative or absolute path.
򐂰 Create an alias for the command name.
򐂰 Change the PATH variable to have /usr/linux/bin in the beginning of the
PATH.
30 Linux Applications on pSeries
Using relative or absolute path
To use a Toolbox RPM package command with its relative or absolute path, you
must of course know where it is stored in your file system hierarchy. In the next
two examples we use the /usr/linux/bin/ls command from the fileutils RPM
package downloaded from the Toolbox Web site, and our current directory is
/home/work. Installation will be covered in greater detail in 2.3.3, How to install
and manage the Toolbox RPM packages on page 36.
The first example is using the
absolute path to the ls command with the --color
option:
/usr/linux/bin/ls --color
The second example is using the relative path to the ls command with the --help
option (our current directory is /home/work):
../../../usr/linux/bin/ls --help
Using PATH search preference
To have the Toolbox RPM package commands to be found first by the running
Korn shell (or a similar shell), we can use the PATH variable and point it to
/usr/linux/bin before the other directories to be searched. Below we show how to
set the PATH variable in the current Korn shell environment:
export PATH=/usr/linux/bin:$PATH
In Example 2-1 on page 31, first we use the AIX nl command, then export the
new PATH environment variable, pointing to /usr/linux/bin first, and then use nl
again (/usr/linux/bin/nl is a symbolic link to /opt/freeware/bin/nl). As you can see
from the output, it is two different commands that are used in each instance.
Note: Changing the PATH variable may cause conflicts with and malfunctions
in some AIX applications, specifically SMIT. It might be necessary to change
the PATH, depending on the tasks to be performed.
Do not change the PATH environment variable in /etc/environment, /etc/profile,
or any other user environment file that is used by applications started by init
at IPL (boot-time).
For system administrators it is not recommended to set or use the
/usr/linux/bin prior to AIX directories in the PATH environment variable at login
time. Use an environment loading script that can be run manually or by
specific applications, such as aixterm (using the ENV variable mechanism in
Korn shell), or alias the desired Toolbox commands.
For users and developers, please use your own preference.

Get Linux Applications on pSeries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.