Autocompletion

Here's a trick that will save you a lot of typing: you can have the shell autocomplete command names for you by pressing the Tab key on your keyboard. For example, in my /bin directory I have a command called uncompress. When I want to execute uncompress, I type unc and press Tab. Because no other command on my system begins with unc, Bash will autocomplete the command name for me.

If there are several possibilities to autocomplete, Bash will do nothing. If you press Tab a second time, Bash will show you the possibilities. Try experimenting with this feature a little. For example, enter un and press Tab twice. Bash should show you a long list of possibilities to autocomplete, such as uname, uniq, etc. Type another character, press Tab again and see how the possibilities are narrowed down.

Autocompletion also works for file and directory names. Let's assume you want to execute the following command:

cat very_long_filename

Chances are that the shell can autocomplete the file name for you when you press Tab after entering the name's first few characters.