help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need bash glob to be expanded and keep it ready in the readline


From: Greg Wooledge
Subject: Re: Need bash glob to be expanded and keep it ready in the readline
Date: Sun, 17 Oct 2021 08:55:07 -0400

On Sun, Oct 17, 2021 at 11:51:26AM +0200, Andreas Kusalananda Kähäri wrote:
> On Sun, Oct 17, 2021 at 01:36:15PM +0700, Budi wrote:
> > How can bash glob star is expanded and keep the cursor ready on the
> > readline so that keep current command from being executed
> 
> You may use "C-x *" (i.e. "Ctrl + x" and then "*") to expand the
> globbing pattern just left of the cursor.  This does not execute the
> current line of input.
> 
> Example:
> 
>       $ touch file{1..20}
>       $ rm file[0-9]
> 
> Assuming the current working directory was initially empty, pressing
> "C-x *" after the "]" on the line above turns the line into
> 
>       $ rm file1 file2 file3 file4 file5 file6 file7 file8 file9

That's the emacs mode binding.  For vi mode, it's ESC * (or more precisely,
it's simply * while you're in command mode, which you get to by pressing
ESC typically).

Just in case the OP (or anyone else who's reading this) is using vi mode.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]