Using Completion in the bash Shell

One of the cool features of the bash shell is command argument completion, with which you can type just part of a command, press , and have bash complete the command for you (Code Listing 3.8).

Code Listing 3.8. In this example, we typed only the ls command followed by “cd pub” and pressed the key; bash completed the command for us.
bash-2.00$ ls
Complete NewProject bogus2
→ ftp   puppy
Completed    News   dead.letter
→ mail  temp
Mail access   files
 → public_html  testme
bash-2.00$ cd public_html/
bash-2.00$

To use completion in the bash shell:

1.
ls -l Use ls -l to list the files in your current directory.
2.
cd ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.