2

I use the terminal app on OSX. Whenever I cd into a deep directory I find it useful to display the successive directory contents as I go. By tapping tab when typing the filepath, it lets me see the current directory. For whatever, reason it takes 3 tab taps to get this to work. The second tab makes the operating "beep" sound play. This is simply annoying. Somebody showed me this feature but perhaps I am using it incorrectly?

  • For bash, search for show-all-if-ambiguous – Mikel May 3 '16 at 4:07
5

When you use tab in bash (which is the shell used by default on OSX), it first tries to complete what you have typed up to now, then show non-ambiguous completion, then (third tab) all completions.

You can change this behavior by creating a file named .inputrc in your home directory, and put in it:

set show-all-if-ambiguous on

This will remove the 'ambigous' step and the corresponding beep. For more options, see: https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html

To further improve completion usage on mac, you can also use the FIGNORE variable to automatically skip some files, for example:

export FIGNORE=.DS_Store

will automatically exclude .DS_Store files from the complexion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.