i am using putty, want to delete all files which having .html extension
I am trying the below ways
1st get the file by using find command
JavaScript
x
find . -name "*.html" -type f
Listing all files having .html extension
now i am going to delete those files
JavaScript
find . -name "*.html" -type f -delete
OR
JavaScript
find . -name "*.html" -type f -exec rm {} +
both are not working for me, anybody know solution
Thanks
Advertisement
Answer
make sure you’re deleting the right files first!
JavaScript
find . -name "*.html" -type f
To delete regardless of permissions…
JavaScript
sudo find . -name "*.html" -type f -delete