Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-02-2005, 03:47 PM   #1
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
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?
Old 04-02-2005, 05:12 PM   #2
Senior Member
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0, RHEL5,6), CentOS, SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64, MacOS, Raspian
Posts: 1,137

Rep: Reputation: 65
What about
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...
Old 04-02-2005, 05:18 PM   #3
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dir tree tommytomato Linux - General 2 05-12-2004 09:10 PM
the bible = the tree of the knowledge of good and evil () Jesus = the tree of life Michael111 General 2 04-14-2004 05:28 PM
tree jshearman Linux - Newbie 8 07-14-2003 10:58 PM
need a P-Tree (Patricia Tree) library manaskb Programming 1 11-02-2002 07:15 PM
tree tda Linux - Newbie 1 05-31-2002 10:59 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration