FAQ: Locate's Equivalent Command in AIX

"There’s No Such Thing As A Silly Question" -- does the cliche sound familiar? In this part of pimp-my-rig reloaded, technical questions are answered. Mail them to me and I will post the answers here. If you have a better answer, by all means share it with us.

Q. Just recently I asked a colleague (whom I consider to be a guru of AIX) what the equivalent of the Linux command locate is on this particular operating system. The equivalent Linux and Solaris commands are previously documented here.

A. Unfortunately, his answer was there is none. But the discussion did not end there. He suggested that I use another command that has a similar function and is quite as flexible as locate.

The commands is whereis (and which_fileset). And this whereis is part of the package bos.rte.commands and bos.compat.links. To determine if whereis is installed on the machine, check as outlined below:

On AIX 5.3:

user@host => which_fileset whereis
/usr/ucb/whereis -> /usr/bin/whereis    bos.compat.links
/usr/bin/whereis                        bos.rte.commands

On AIX 6.1:
user@host => which_fileset whereis
/usr/ucb/whereis -> /usr/bin/whereis    bos.compat.links
/usr/bin/whereis                        bos.rte.commands

The above command is dependent on another package and without that there will be errors as outlined below.
user@host => which_fileset whereis
The /usr/lpp/bos/AIX_file_list file does not exist.
Please install the "bos.content_list" fileset
and try the "which_fileset" command again.

When all is well. Try it out:
user@host => whereis hosts
hosts: /etc/hosts.allow /etc/hosts.deny /etc/hosts /etc/hosts.bak /usr/share/man/man5/hosts.5.gz

Did I mention the same command works for Solaris and Linux? It does (given the dependent packages are installed), so add this option on those operating systems too!

You might also be interested in:


We at pimp-my-rig strive to keep on improving, help us reach that goal by leaving comments or constructive criticisms. Don't miss out on our next feature -- subscribe via RSS (What is RSS?).

Share This