How to add core GNU commands to a pre-existing AIX system

aixgnuksh

In another thread (What's the easiest way to sort a list like this) someone asked if we had "GNU ls" on the system because it would provide a solution. We do NOT have GNU ls installed but it got me thinking:

  1. when you install things like "GNU ls" does it just install "ls" or does
    it contain replacements for a suite of Unix commands?

  2. Would GNU ls support all the flags that the base-O/S ls command supports?

The second question is because we have a lot of ksh93 scripts on our AIX systems, and I want to ensure they continue to function as expected. If I installed GNU ls, would I just use a fully-qualified path to GNU ls when I needed it's functionality in a given ksh script, say /opt/GNU/ls? Is that how one would typically add/use a GNU command on a mature system?

Best Answer

You can build GNU coreutils from source, and manually copy the resulted ls(1) command as another name, under PATH, such as /usr/bin/gls.

For example the simplest steps are:

./configure <configure-options-you-may-want>
make
cp src/ls /usr/bin/gls
Related Question