The standard ls that comes with 10.3 doesn't give us any colors.
du and df report absurd numbers. du also doesn't take the "--max-depth" argument.
These things can be annoying, so here's a way to fix them. ;)
** note: this hint assumes you have gcc or another working compiler installed, and that you're using /bin/bash as your shell. otherwise, it's up to you to interpret the instructions to your shell's scripting syntax. **
[robg adds: This hint is an update to several older ones (including two on adding color to the ls in Panther) which discussed similar solutions...]
First Step: Get New Software
For all of these features, you need GNU Fileutils, or GNU Coreutils. You can get these from ftp.gnu.org. Be sure to also visit the GNU webpages regarding Coreutils and Fileutils.
coreutils is a later version than fileutils, and includes the shellutils and textutils sets as well. coreutils will also install via Darwinports, so if you have that, all you have to do is
port install coreutils
It will put all the utilities into /usr/local/bin (or other location you've specified to Darwinports), with all the commands prefixed with a g, like gls and gdf. If you install with Darwinports, you can go straight to Step Two as soon as it's done installing../configure --prefix=/path/to/install/to
make
make install
Note: Be sure to read the INSTALL and README that come with the source package, as different versions may or may not need configure flags for OS X, for specifying /usr/local/bin vs. /bin, or for adding the "g" prefix to the filenames. Your standard ls and other commands live in /bin, so be sure to back them up if you decide to completely replace them. I haven't tried outright replacing the commands, so I have no idea what it might break, but I don't recommend it. If you do replace them, and nothing breaks, you can skip to customizing the colors (and leave a comment to tell us whether it works if you do that!).
You'll need admin or root priv's to install anywhere outside of your home directory, so if you don't have those permissions, you can still get the benefits of GNU utilities by installing to a "bin" directory in your home area, and adding that to your PATH during Step Two
alias ls='gls --color=tty'
alias du='gdu'
alias df='gdf'
You can make aliases for as many of the GNU programs as you'd like. echo $PATH
in your Terminal to find out. If the location isn't listed in the output, add the following to your .profile or /etc/profile, above the "alias" lines:
export PATH=$PATH:/path/to/install/dir
(where "/path/to/install/dir" is the location you installed the programs)type ls to find out. If it says "ls is aliased to `gls --color=tty'", then you're good to go! Otherwise, you'll need to figure out why your Terminal isn't sourcing the file you thought it was. The first place to look is Terminal:Preferences, but a full investigation is beyond the scope of this hint.echo $LS_COLORS
It's blank!!! What do we do? Well, GNU fileutils came with "dircolors" or "gdircolors", but even if you run it, it doesn't tell you much. The secret is to add the following color codes into your .profile or /etc/profile:
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so
=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;
41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;
32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31
:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z
=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=0
1;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=
01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'
Note: If you copy and paste that, make sure you remove any line breaks, or otherwise adjust for them, else your shell will give you errors when you login.Mac OS X Hints
http://hints.macworld.com/article.php?story=20040410043824914