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