'find files matching several patterns in bash
I am trying to find all the files in a folder that ends with any of this expressions:
"00.png" or "25.png" or "50.png" or "75.png"
I am using the command
find . -type f -name '(*00.png|*25.png|*50.png|*75.png)'
with no success, what is the correct way to do it?
Solution 1:[1]
Without using any regex you can use:
find . -name '*[05]0.png' -o -name '*[27]5.png'
If you are really keen to use regex then use this gnu find command:
find . -regextype egrep -regex '.*/([05]0|[27]5)\.png$'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
