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) ...

Get Penetration Testing with the Bash shell now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.