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

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -