Brydon Gibson
Brydon Gibson

Reputation: 1307

Match filename with first letter in either lower or upper case in bash

This is more of a general question, but I can't figure out how to google it since it's not regex matching.

Say I have a directory with

install_script
Install_script
[and to make it difficult]
xstall_script

If I want to remove just the install scripts, how do I do it?

I'm thinking something along the lines of

rm [iI]nstall_script

but that doesn't work.

Is there a class-specifier-like utility in bash?

Upvotes: 1

Views: 55

Answers (1)

you can use

rm -f {I,i}nstall_script

Upvotes: 1

Related Questions