LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   remove all files with same extension? (https://www.linuxquestions.org/questions/linux-general-1/remove-all-files-with-same-extension-379827/)

scratchnz 11-04-2005 02:23 AM

remove all files with same extension?
 
Hi all,
can anyone tell me how to rm all files in my directory structure with the .lck extension? Easy enough in the current directory... rm -f *.lck but i have lots of subdirectories I want them removed from too.
I'd have thought the recursive flag rm -rf *.lck would have done it?
Does it matter that they are hidden files? (eg: .index.html.lck

Thanks
Scratch

ashamril 11-04-2005 03:40 AM

$ find . -name *.lck -exec file {} \; -exec rm -i {} \;


All times are GMT -5. The time now is 09:48 PM.