Using HFS capitalization features with shell aliases

May 06, '03 09:33:00AM

Contributed by: Anonymous

For those of us who routinely create aliases with the same name as an actual command, e.g. (in Bourne style):

 alias cp='cp -i'
 alias ls='ls -ACF --color'
 alias mv='mv -i'
 alias rm='rm -i'
The case-respecting / case-ignoring aspect of HFS under Darwin means that you can get the original unaliased command by changing capitalization. That is, typing ls will use the alias, but typing LS, Ls, or lS will run the "ls" binary directly with no alias.

Of course, UNIX users already know you can do it with escape characters, by typing \ls, but this is a neat Darwin quirk.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030502171047779