variable expansion on the bash command line
autocompletion is literally what it's name might suggest, you start to type
something and it's completed for you.
This is usually enabled for simple things such as file and directory names,
and by default it will be activated by the "TAB" key.
For example if you wish to look at the system's password file you might wish
To save keystrokes you can actually type:
:In the Debian bash package there is a file installed called
/etc/bash_completion, this adds a lot more useful behaviours to bash
including:a.. Auto completion of hostnames, for SSH
b.. Auto completion of Debian specific utilities
To cause your shell to use it run the following command, then login again:
echo '. /etc/bash_completion' >> ~/.bashrc
This will now give you a lot more completions, most usefully I find the
apt-get upgTAB ...Instead of typing out the filename we can take
advantage of another of bash's shortcuts - it remembers the last argument to
the previous command, and allows you to insert it into the current shell
with "Esc .".Run the following to see how it works:cat /etc/passwd
cp ESC. .
(That is press Esc, then press '.' afterwards' - the last argument to the
previous command is inserted into the command line).