We were arguing the most useful command line editing feature at a meeting yesterday. The winner was Ctrl-R (backwards-history-search) until someone said, "Do you guys know about carets?" He explained:
Say you type a command to list the contents of the directory /arch/Xapps/packages, but you type it incorrectly, like this:
% ls /arch/xapps/packagesAugh! The 'x' is lowercase! Instead of retyping the command with an uppercase 'X', or hitting a bunch of keystrokes to modify it, type this and hit the return key:
% ^xapp^XappWhen you hit return, the shell grabs the previous command, substitutes "Xapp" for the first occurrence of "xapp" and executes the command. So typing ^xapp^Xapp and return would execute what you wanted in the first place:
% ls /arch/Xapps/packagesSaves some typing and time when the fingers work faster than the keyboard!
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020710081348822