Personally, I think the Mac OS X unix userland is rotten. There are apple tools mixed with some current unix tools and there are outdated unix tools like locate. Maybe you didn’t even notice that but locate for example doesn’t even know the -i option for case insensitive lookups in the locate.datbase. As usual, you can help yourself with MacPorts. Simply install the GNU coreutils and findutils. For convenience provide the +with_default_names
option. If you don’t add this option you get glocate instead of locate and so on. Now the new locate can’t find anything unless you run updatedb from /opt/local/bin/updatedb
. After that everything should be fine. Checkout what tools are included in coreutils and findutils by clicking on the equivalent hyperlinks. This resolves the weird behavior of tools on OS X that you might expect to work like on your FreeBSD or Linux machines.
Install coreutils (the -c option is equivalent to sudo port clean portname):
sudo port -c install coreutils +with_default_names
sudo port -c install findutils +with_default_names
Locate before the installation:
man locate
LOCATE(1) BSD General Commands Manual LOCATE(1)
NAME
locate -- find files
SYNOPSIS
locate pattern
DESCRIPTION…
and afterwards:
LOCATE(1) LOCATE(1)
NAME
locate - list files in databases that match a pattern
SYNOPSIS
locate [-d path | --database=path] [-e | -E | --[non-]existing] [-i |
--ignore-case] [-0 | --null] [-c | --count] [-w | --wholename] |-b |
--basename] [-l N | --limit=N] [-S | --statistics] [-r | --regex ]
[--max-database-age D] [-P | -H | --nofollow] [-L | --follow] [--ver-
sion] [-A | --all] [-p | --print] [--help] pattern...
DESCRIPTION…
I think you get the idea.