LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   rm down the tree (https://www.linuxquestions.org/questions/linux-software-2/rm-down-the-tree-309013/)

shanenin 04-02-2005 02:47 PM

rm down the tree
 
I want to remove a bunch of files that end with .conf. I need to be able to go down the directroy tree several layers. Can that be done with just the rm command? All of these files are in the directory /mnt/media. For instance
rm -rf /mnt/media/*conf will only remove those files in the direcrory /mnt/media, but not any of the sub directorys. Is there a way to have it go all the way down the directory tree?

rnturn 04-02-2005 04:12 PM

What about
Code:

cd top-of-tree-you-want-to-clean
find . -type f -name '+ACo-.conf' -exec rm -i +AHsAfQ- +AFw-;

Exclude the '-i' switch if you're absolutely, positively certain you want to delete all of the files that 'find' ferrets out.

Hope this helps...

shanenin 04-02-2005 04:18 PM

thanks


All times are GMT -5. The time now is 08:47 PM.