Find command with regex for multiple file extension -


i wondering if possible in find command. trying find specific files following extensions sed after. here's current command script:

find . -regex '.*\.(sh|ini|conf|vhost|xml|php)$' | xargs sed -i -e 's/%%mefirst%%/mefirst/g' 

unfortunately, i'm not familiar in regex need.

i see in comments found out how escape standard find -regex re, can specify type of regex supports without escapes, making bit more legible:

in gnu findutils (linux):

find . -regextype posix-extended -regex '.*\.(sh|ini|conf|vhost|xml|php)$' | ... 

in freebsd:

find . -e -regex '.*\.(sh|ini|conf|vhost|xml|php)$' | ... 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -