Running Ubuntu 18.04 and using bash. So I am aware of how to use tabs at the command line to auto-complete the next token with file paths and what have you.

Question: is there an easy shortcut for quickly deleting a token? Obvious use case: you auto-complete the wrong token by mistake, have to backspace the name before going forward again. It'd be nifty if 'Ctrl-Shift-Tab' undid the suggestion, a bit like how that's often the command to go to the previous tab in web browsers.

  • 1
    @Kusalananda, suppose that was an obvious oversight, I amended the question - I'm using bash. – Daniel Soutar Oct 2 '18 at 9:52
  • Is superuser.com/questions/195158/undo-bash-autocompletion what you are looking for? – Dirk Oct 2 '18 at 10:01
  • @Dirk seems this was a duplicate - I'll mark this question as such. Thanks for the link! Swear SO never gives those links when you're searching for them... – Daniel Soutar Oct 2 '18 at 11:31
  • 2
    @DanielSoutar Since this is a Q&A site rather than a web forum, it's not the convention to edit post titles with descriptors like "DUPLICATE". In the case of duplicates on the same site, there's close-as-duplicate functionality. In cases like this one, where there's an answer on another site in the network, posting an answer summarizing the info quickly and linking to the other site is fine. (You can mark your own answer as accepted.) – mattdm Oct 2 '18 at 15:25

For those on this question, please refer to this SuperUser question, Undo bash autocompletion. The command I personally found useful was Ctrl _, although the tendency to accidentally type Ctrl - instead is annoying and probably something you'll want to change. Thanks to Dirk for pointing this out.

  • 2
    To clarify, C-_ is "undo the last editing command", so it's more general than undoing a tab completion. Alternatively, you can use C-x C-u to achieve the same. – Benjamin W. Oct 2 '18 at 16:20

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.