LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-02-2005, 02:47 PM   #1
shanenin
Member
 
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, 04:12 PM   #2
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818

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

Original Poster
Rep: Reputation: 30
thanks
 
  


Reply



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 08:10 PM
the bible = the tree of the knowledge of good and evil () Jesus = the tree of life Michael111 General 2 04-14-2004 04:28 PM
tree jshearman Linux - Newbie 8 07-14-2003 09:58 PM
need a P-Tree (Patricia Tree) library manaskb Programming 1 11-02-2002 06:15 PM
tree tda Linux - Newbie 1 05-31-2002 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:30 PM.

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