Make Terminal’s autocompletion case-insensitive in Ubuntu

After seeing how to cycle through Terminal’s autocomplete options using the TAB key, here’s how to get rid of another minor annoyance (for some). The autocompletion in Terminal is case-sensitive; if you have a directory called Downloads in your home directory, writing

cd dow

and pressing TAB will not auto-complete to cd Downloads/ 

To remedy this for the current Terminal session only, run this:

set completion-ignore-case On

More likely though, you’ll want to make this permanent. Run these in Terminal (courtesy of this post):

# If ~./inputrc doesn't exist yet, first include the original /etc/inputrc so we don't override it
if [ ! -a ~/.inputrc ]; then echo "\$include /etc/inputrc" > ~/.inputrc; fi 

# Add option to ~/.inputrc to enable case-insensitive tab completion
echo "set completion-ignore-case On" >> ~/.inputrc

To change this for all users, edit /etc/inputrc and add this line:

set completion-ignore-case On

You might have to restart Terminal, but after that you’re set. Happy tabbing.

Cycle through autocomplete options in Ubuntu’s Terminal with the TAB key

The Terminal in Ubuntu, a.k.a. bash shell or console, autocompletes file names when the TAB key is pressed. On multiple hits, however, it lists all the options and waits for more inputs to disambiguate.

For instance, in my home directory I have a directory called Documents and another called Downloads. When I type Do and press TAB, nothing happens. Pressing TAB again shows Downloads and Documents, and now I must either type c or w to choose between them. I personally prefer the Windows Command Line style, where tabbing the first time cycles through Documents and Downloads.

To change to the cyclic completion behaviour, simply edit the .bashrc file in your home directory. To change for all users, edit the /etc/bash.bashrc file. Add the following line:

bind '"\t":menu-complete'

Then restart Terminal and you’re done!

P.S. You might also want to see how to make Terminal’s autocompletion case-insensitive.

Move window buttons to the right in Ubuntu 10.04

In Ubuntu 10.04, move the window control buttons (Maximize, Minimize, Close) to the right-hand side by following these simple steps:

  1. Open gconf-editor (you can use Alt+F2 to bring up Run Application to execute this command)
  2. Navigate to apps > metacity > general and set the button_layout property’s value to menu:minimize,maximize,close

gconf-editor screenshot