Ok; suppose I'm in Bash and I have several files in a folder. Several of them are named file☠☡☢☣.txt, where ☠☡☢☣ starts with crazy untypable unicode characters. How would I refer to one of them? Pushing tab only auto-completes to file, and then it wants you to type a crazy character. Is there some way to tell bash "select the 3rd one in that list you just gave me"?

3 Answers 3


I would suggest you work around it and use another type of key binding with readline, such as Shift+TAB. Add the following to your ~/.inputrc:

"\e[Z": menu-complete

Then issue an exec bash (this should then read the settings in your ~/.inputrc). As a one-off, instead of restarting bash, you can set up the same binding by running bind '"\e[Z": menu-complete'.

You should now be able to use repeated ShiftTAB sequences to cycle through the filenames that match (rather than having to input the next matching character). This will work for any command issued (as it's a standard read-line command that is being bound to the ShiftTAB sequence). As noted by the OP, this does not effect the standard behavior of the TAB key, it just adds the functionality of the ShiftTAB combo.

  • edited to mention the use of exec bash, as that's quite an important step to make it work! ;)
    – Drav Sloan
    Commented Sep 17, 2013 at 19:47
  • Thanks! For anyone who's wondering, this doesn't seem to change the normal functionality; it just adds the shift-tab key combo.
    – Erhannis
    Commented Sep 17, 2013 at 20:16
  • Correct, please leave my tab key alone!! :) I'd be upset if that changed :D
    – Drav Sloan
    Commented Sep 17, 2013 at 20:18

Another way that works sometimes is to use ? or * globbing wildcards and then typing some of the remainder of "stuff" until you get a unique match with tab completion.


Go to the directory containing file☠☡☢☣.txt and enter ls -i.  You will see the line:

xxxxx file☠☡☢☣.txt

where xxxxx is the index number of file☠☡☢☣.txt.  Enter:

find . -maxdepth 1 -inum xxxxx -exec /bin/mv -i {} bettername.txt \;

where xxxxx on the preceding line is the aforementioned index number obtained from ls -i.  This renames file☠☡☢☣.txt as bettername.txt.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .