Bash offers powerful ways to customize and enhance the command-line experience, many of which are hidden in plain sight. Two particularly useful options can be configured in the ~/.inputrc file: show-all-if-ambiguous and completion-ignore-case. These options improve how tab-completion behaves, making it more intuitive and responsive.
With just a couple of lines added to a configuration file, you can reduce keystrokes, avoid typing errors, and make working in the terminal feel smoother. In this guide, we’ll explore what these settings do, how to enable them, and why they matter. If you’re already familiar with other Bash productivity hacks like reusing the last argument with !$, this is a natural next step.
Show All Matches Immediately with TAB
The first setting is show-all-if-ambiguous. When this option is turned on, pressing TAB will immediately show all matching options for a partial input, even if the shell isn’t sure which one you meant. This saves time by skipping the second TAB press that is normally required.
For example, suppose you have multiple directories or commands that start with doc. With this setting enabled, typing cd doc and pressing TAB will instantly show all available matches without waiting for another keystroke.
This feature makes command discovery faster and is especially helpful for users who regularly navigate deeply nested directory structures. For even more ways to display and understand Linux directory trees, check out this article on visualizing directory structures.
Enable Case-Insensitive Completion
The second setting is completion-ignore-case. This option allows tab-completion to work regardless of letter casing. With it enabled, typing cd ~/des and pressing TAB will complete to ~/Desktop, even though the case doesn’t match exactly.
This is particularly helpful in environments where filenames may have mixed cases, such as files synced from Windows systems or user-generated directories. No need to remember exact capitalization—just start typing and let Bash do the rest.
For administrators working in shared environments or managing limited access systems, simplifying interactions like these can make a big difference. It complements workflows that involve restricted privileges, like those described in this guide to limited root access on Ubuntu.
How to Apply These Settings
To enable these two features, you just need to add a couple of lines to your ~/.inputrc file. This file controls how the Readline library (used by Bash) interprets user input.
$ echo 'set show-all-if-ambiguous on' >> ~/.inputrc
$ echo 'set completion-ignore-case on' >> ~/.inputrc
If you want these settings to apply system-wide, you can instead add them to the global /etc/inputrc file. This ensures a consistent experience across all user sessions:
$ sudo sh -c 'echo "set show-all-if-ambiguous on" >> /etc/inputrc'
$ sudo sh -c 'echo "set completion-ignore-case on" >> /etc/inputrc'
Once updated, you can either restart your terminal or source the file using bind -f ~/.inputrc for the changes to take effect immediately.
Conclusion
Enabling show-all-if-ambiguous and completion-ignore-case might seem like minor tweaks, but they can significantly improve your efficiency at the command line. These settings reduce unnecessary keystrokes, minimize input errors, and streamline directory and file navigation.
When combined with other Bash enhancements—like history expansion via !$, these tweaks can help you become a more confident and faster terminal user. Whether you’re managing system access, navigating complex directory trees, or just want a more responsive shell, these adjustments are worth your time.
And if you’re working on multi-user systems or exploring secure workflows, don’t miss our guide on managing limited root access on Ubuntu.






Pingback: A Grep Trick Every User Should Know: The Square Brackets in the Grepped ps Output - iDoLinux
Pingback: A Grep Trick Every User Should Know: The Square Brackets in the Grepped ps Output - Open Source Software News
Pingback: How to Change the Default Text Editor in Bash, Zsh, and Ksh - iDoLinux