Tab completion, part 2
If you're new here, you may want to subscribe to my RSS feed.
In the last post we discussed how tab completion makes typing Unix commands much easier. The downside, as Janssen pointed out, is that tab completion is case-sensitive, so typing cd doc and hitting tab won’t complete cd Documents/. But there’s a way to change this.
In your home folder you’ll find a file called .profile that contains settings for working in the bash shell (which is what you do every time you use Terminal.) It’s sort of the “preferences” file for the command line. The .profile file can do a lot of things, one of which is making tab completion case-insensitive. (We’ll cover more uses of .profile later.)
Because .profile begins with a dot, it’s invisible to most Mac OS X applications. A notable exception is Smultron, a free text editor that has an “Open Hidden” option. You can either use Smultron to open .profile in your home folder, or open Terminal and type open .profile, which should open the file in Apple’s TextEdit. If you don’t have this file, you’ll just create a new empty file by the same name and save it.
The line you’ll add to .profile is the following:
bind "set completion-ignore-case on"
If your .profile contains other text, simply put this at the end on its own line. If you’re creating .profile from scratch, this is the only line you’ll need. Save and close .profile.
After closing and reopening Terminal, your tab completion should now be case-insensitive. If you type cd doc and hit tab, it should fill in cd Documents/.

