Answer the question
In order to leave comments, you need to log in
How to list files with FIND command?
Task: output files with jpg and png extensions, but exclude edit and 200x200 in the path/name to the file.
If you don't use extensions, then it works:
$find /var/www/test -type f ! -regex ".*\(edit\|200x200\).*"
If you don't use a regular expression,
$find /var/www/test -type f works! -name "*.jpg" -o -name "*.png"
If we combine reget and the name pair, then the output is not correct:
$find /var/www/test -type f ! -regex ".*\(edit\|200x200\).*" -name "*.jpg" -o -name "*.png"
What to do?
Answer the question
In order to leave comments, you need to log in
$find /var/www/test -type f ! -regex ".*\(edit\|200x200\).*" -name "*.jpg" -o -name "*.png"
If you do not use a regular expression, then it works:
$find /var/www/test -type f ! -name "*.jpg" -o -name "*.png"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question