Answer the question
In order to leave comments, you need to log in
How to delete files in a directory but leave files by mask?
You need to delete all files
in the specified folder on the server , but you need to leave only those that end with:
*_large.jpg
*_thumbnail.jpg
*_large.jpeg
*_thumbnail.jpeg
*_large.png
*_thumbnail.png
If this helps , here's a command that works great, but it just deletes all files in the directory and subdirectories.
find public_html/images/test/01 -type f -name "*.*" -delete
Answer the question
In order to leave comments, you need to log in
find public_html/images/test/01 -type f ! -name '*_large.*' ! -name '*_thumbnail.*' -delete
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question