Sunday, March 25, 2007

Auto Complete

Possibly the single greatest feature in a Linux system is auto complete. If you have never used this feature before, open a shell and start typing a command, and press the 'Tab' key before you finish typing it.

This feature saves so much time when typing commands and especially paths. But it isn't just a time saver.

Another great use for it is to verify the existence of files and directories. For instance, if you think a file exists in /etc/apt/ called sources.list but you aren't sure, you can type:

'less' (or cat or more) followed by '/etc/apt' and then start pressing the 'Tab' key. The auto complete feature will first add a '/' to the end of '/etc/apt', which verifies that it is in fact a directory, and then when you continually press tab, it will display the files within the directory.

Mastering the use of the auto complete feature is one of the first steps to saving yourself a lot of time when using the command line.

1 comment:

Anonymous said...

Hi Bob,

i agree with Autocompletion being a life saver!!! However, a small corection (if I may!!)fer it's a feature of the BASH shell (admittedly default on most Linux distros), and also some other shells. Including TCSH (Turbo C shell), and i think ZSH. So you can get line completetion on most UNICES. Although it never seems to work as nice on Solaris or Tru64. Works cool on OSX though!!