Find and delete all files with specific extension linux

To list all the files with an extention .log

find . -name "*.log" -type f -print0 | xargs -0 /bin/ls

To remove all the files with an extention .log

find . -name "*.log" -type f -print0 | xargs -0 /bin/rm

Ravindra Shinde
Ravindra Shinde
Research Scientist

I am a theoretical and computational condensed matter physicist and quantum chemist. I have around 10 years of research experience, with 6 years in scientific code development. I have authored 16 research articles, 1 book, and peer-reviewed 25 manuscripts.



Next