Contents

How to Use Case-Insensitive Tab Completion in Bash

For many Linux developers, the Bash terminal is an essential tool. One way to boost productivity is to make tab completion case-insensitive, so you don’t have to match uppercase and lowercase letters exactly when completing file or command names.

Step-by-Step Guide

  1. Create or edit the .inputrc file in your home directory:

    nano ~/.inputrc
    
  2. Add the following lines to enable case-insensitive completion:

    $include /etc/inputrc   # Include the system's default inputrc settings
    set completion-ignore-case On  # Enable case-insensitive tab completion
    
  3. Save the file and restart your terminal.

Now, when you use tab completion, Bash will ignore case differences, making it easier and faster to complete file and directory names without worrying about capitalization.

Example:

If you have a file named MyScript.sh, typing mysc and pressing Tab will complete to MyScript.sh automatically.


This simple tweak can save time and reduce frustration, especially when working with files or directories that use mixed case names.