expand * in bash prompt

Created: — modified: — tags: bash

TL;DR: ls <Esc>*

A quick note: if you can't simply are too lazy to build proper expressions to include several files while excluding some others on the interactive command prompt, you can simply expand * online. For that, prefix it with <Esc> button press. Just note that it works only when prefixed with some command, for example ls, and not with an empty command prompt. It also works with prefixes, like this:

ls /b<Esc>* -> ls /bin /boot

But I'm not sure how to make it work with suffixes, like ls *.txt.

If someone can find where I've read about it, or some kind of documentation - I'll be happy to link it from here!