Better bash completion?

Bash completion is great and everything, but I spend more time than is advisable dealing with numerous timestamped files.

$ mv core-image-sato-qemux86-64-20140204[tab]
core-image-sato-qemux86-64-20140204194448.rootfs.ext3
core-image-sato-qemux86-64-20140204202414.rootfs.ext3
core-image-sato-qemux86-64-20140204203642.rootfs.ext3

This isn’t an obvious choice as I now need to remember long sequences of numbers. Does anyone know if bash can be told to highlight the bit I’m being asked to pick from, something like this:

$ mv core-image-sato-qemux86-64-20140204[tab]
core-image-sato-qemux86-64-20140204194448.rootfs.ext3
core-image-sato-qemux86-64-20140204202414.rootfs.ext3
core-image-sato-qemux86-64-20140204203642.rootfs.ext3

4 thoughts on “Better bash completion?

  1. common prefix highlight .. could be very nice !!
    still here is my ~/.inputrc

    set completion-display-width 1
    set completion-ignore-case on
    set completion-prefix-display-length 2
    set show-all-if-ambiguous on
    Control-t: menu-complete

    see man bash section ‘Readline Variables’

  2. I too would like this sort of functionality with bash. Hopefully someone can patch this in. I don’t like the ellipsis mode very much.

    For now, if you do modify your ~/.inputrc make sure to add:

    $include /etc/inputrc

    at the top of the file, otherwise the system defaults will be ignored.

    HTH,
    James

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>