The command-line oddities of Mac OS X’s BSD heritage drive me insane. I much prefer the behavior of the GNU toolchain, as provided by Ubuntu Linux.
To begin, first install MacPorts.
MacPorts Installation Variant +with_default_names
With several MacPorts packages, the +with_default_names variant may be specified. This causes package contents to be installed without the default “g” prefix. For example, without +with_default_names, find would be installed as gfind.
Autocompletion
1) Use MacPorts to install the bash-completion package:
sudo /opt/local/bin/port install bash-completion
2) Edit ~/.bash_profile to load the correct autocompletion script:
if [ -f /opt/local/etc/bash_completion ]; then /opt/local/etc/bash_completion fi
Open a new terminal window, and commands should auto-complete according to the GNU specification.
Find
The GNU version of find helpfully assumes that, if no arguments were given, you wish to search the current directory. The OS X (BSD) version has no idea what to do without a directory specification.
sudo /opt/local/bin/port install findutils +with_default_names
This package includes find, gfind, glocate, goldfind, gupdatedb, gxargs, locate, oldfind, updatedb, and xargs.
Core Utilities
This vaguely-named package provides a large number of standard GNU tools.
sudo /opt/local/bin/port install coreutils +with_default_names
Update Path
In order to call the MacPorts-installed tools by default, your path will have to be updated to include /opt/local/libexec/gnubin/. I added the following to ~/.bash_profile:
export PATH="/opt/local/libexec/gnubin/:$PATH"
As a long time Linux user that is trying to learn OS-X Mountain Lion, thank you very much for posting this useful guide.