Re: [Fish-users] Wildcards and ranges, am I missing something?
Status: Beta
Brought to you by:
liljencrantz
|
From: Greg R. <gre...@um...> - 2026-10-03 19:21:49
|
On Sat, Oct 3, 2026, at 11:02 AM, Ralph Seichter via Fish-users wrote:
> Having read about wildcards (1) and fish for Bash users (2), I wonder
> about the fish equivalent of calling `rm [b-k]*` in a Bash session.
For a non-fish solution, which would work with any shell, use find:
find . -maxdepth 1 -iname '[b-k]*'
You can change "iname" to "name" to make it sensitive to case. You can add "-type f" if you want only regular files.
The find command can used with command substitution:
rm -iv (find . -maxdepth 1 -iname '[b-k]*') # works in fish
or by itself:
find . -maxdepth 1 -iname '[b-k]*' -execdir rm -iv '{}' '+'
|