Say I have a directory containing the following files:
ls
ABC BCD CDE DEF abc bcd cde def Abc
How to remove all the files with filenames all in uppercase? (remove ABC BCD CDE DEF in this case)
Using GNU find:
find . -maxdepth 1 ! -name '*[![:upper:]]*' -delete
Note that this does not descend into subdirectories and does not delete non-empty directories whose filenames are all in uppercase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With