Another feature of bash; is automatic completion of your command lines. For instance, let's look at the following example of a typical cp command:
It's a big pain to have to type every letter of
this-is-a-long-file whenever you try to access it. So, create
this-is-a-long-file by copying /etc/rc to it. Now, we're going to do the above
cp command very quickly and with a smaller chance of mistyping.
Instead of typing the whole filename, type cp th and press and
release the . Like magic, the rest of the filename shows up
on the command line, and you can type in shorter. Unfortunately,
bash; cannot read your thoughts, and you'll have to
type all of shorter.
When you type , bash looks at what you've typed and
looks for a file that starts like that. For instance, if I type
/usr/bin/ema and then hit
, bash will find
/usr/bin/emacs since that's the only file that begins
/usr/bin/ema on my system. However, if I type /usr/bin/ld and
hit
, bash beeps at me. That's because three files,
/usr/bin/ld, /usr/bin/ldd, and /usr/bin/ld86 start
/usr/bin/ld on my system.
If you try a completion and bash beeps, you can immediately hit
again to get a list of all the files your start matches so
far. That way, if you aren't sure of the exact spelling of your file,
you can start it and scan a much smaller list of files.