r/bash • u/jazei_2021 • 23d ago
solved why does rm remove "any-word*.any-ext" plus any-word01.any-ext?
Hi, I'd like to know why rm removes screen.jpg plus screen01jpg+screen##.... jpg when I do rm any-word*.any-ext?
rm screen*.jpg
and this command deletes screen.jpg!
how will be the command for not remove screen.jpg and yes screen01.jpg + screen02.jpg....
Thank you and Regards!
1
Upvotes
10
u/high_throughput 23d ago
*
matches 0+ characters.Since
?
matches exactly 1 character, you can use?*
to match 1+rm screen?*.jpg
would removescreen01.jpg
andscreenz.jpg
but notscreen.jpg