Find all files with same extension (recursively and case insensitive): fpx
find . -type f -iname "*.fpx"
Find all files except ones with extensions: webp, jpg, jpeg (recursively and case insensitive):
find -type f ! -iname "*.webp" ! -name "*.jpg" ! -name "*.jpeg"
Find all files and directories starting with a specific string in the current directory (recursively and case insensitive):
find . -iname 'string*'
Find all files and directories in current directory and its subdirectories containing a string (recursively and case insensitive):
find . -iname "*string*"
Find all files larger than value (recursively):
find -type f -size +10M
M stands for megabyte, you can switch it to K for kilobytes or G for gigabytes. For files smaller than value, just swith from + to –
Find and delete all files with a specific extension (recursively and case insensitive):
find . -iname "*.webp" -type f
This is a “dry run” it will only list files and will NOT delete them, if you add: -delete switch it will delete them:
THIS ONE IS VERY DANGEROUS!!!
find . -iname "*.webp" -type f -delete
