ESC-g for glob expansion in bash

Just like <TAB> expands a filename given a prefix you can also expand a file name given the middle part of a file name.

Example:

$ ls
abc1def  abc2def  abc3def  abc4def  abc5def
$ ls *2*<ESC>g

Which will expand to:

$ ls abc2def

via a stackoverflow question

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: