Book Image

Penetration Testing with the Bash shell

By : Keith Harald Esrick Makan
Book Image

Penetration Testing with the Bash shell

By: Keith Harald Esrick Makan

Overview of this book

Table of Contents (13 chapters)

Customizing tab completion


Tab completion is what happens when you type a command and press the Tab key twice on your keyboard. The list of possible options that shows up is the completion suggestion. Believe it or not, you can actually control the commands and even the arguments that show up when you use tab completion, depending on which command you are executing. Being able to control your tab completion can prove to be quite an invaluable skill during your everyday experiences with bash. So, without rambling on about it for too long, let's find out how tab completion actually works.

When you press the Tab key twice, a special predefined function is executed by the bash shell. This function determines which command you are executing (if any) and hooks in (this is just jargon for schedules) another defined function that is in charge of determining which options to display as suggestions. What we will do in this section is actually develop one or two of these functions to make use some of...