I'm making a bash script; how do I find files not ending with specific extensions?
#!/bin/bash
find . -type f -print | grep "\.\(?!psd\|xcf\).+$"
Thank you.
You can use:
find . -regextype posix-egrep -type f ! -regex '.*\.(psd|xcf)$'
Or without regex:
find . -type f -not \( -name '*.psd' -o -name '*.xcf' \)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments