Find all files in subdirectories and perform an action (delete) Print

  • 19

find . -name .htaccess -exec ls -l {} \;

the above will find all .htaccess files in all subdirectories, starting from your current location, and "ls -l".

You can replace ls -l with rm -rf for example, to remove them.


Was this answer helpful?

« Back


Warning: PHP Startup: Unable to load dynamic library 'tidy.so' (tried: /opt/cpanel/ea-php81/root/usr/lib64/php/modules/tidy.so (libtidy.so.5: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php81/root/usr/lib64/php/modules/tidy.so.so (/opt/cpanel/ea-php81/root/usr/lib64/php/modules/tidy.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0