Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Your Distro > Debian Linux Help
Reload this Page Newbie question about deleting multiple instances of a particular directory
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Debian Linux Help Discussions related to Debian GNU/Linux.

Reply
 
Thread Tools Display Modes
Old 08-29-2007   #1 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 3
Newbie question about deleting multiple instances of a particular directory

Hi There,

I am looking to delete all directories and files within the directories, from a directory.

Every directory has the same folder within it, which I am looking to remove, for example...

/var/www/website/.svn/
/var/www/website/folder1/.svn/
/var/www/website/folder1/subfolder1/.svn/

etc.

How can I remove all the folders named .svn/ (and all subfiles) instantly?

(If anyone is super clever and also knows the Windows command, that will save some Googling )

So far I think I'm close with

rm -Ri /var/www/ *.svn/

Any ideas? Thanks guys.
stuartb is offline   Reply With Quote
Old 08-29-2007   #2 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, INDIA
Posts: 18,411
Hi and Welcome !

Code:
rm -rf  /var/www/website/.svn
Above command will remove .svn folder including subfolders under .svn.

Check manual of rm command. man rm
__________________
New Users: Read This First


devils casper is offline   Reply With Quote
Old 08-29-2007   #3 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 3
Hi no that didnt work, but I found a solution for other peoples reference,

find . -name .svn | xargs rm -vRf

cheers
stuartb is offline   Reply With Quote
Old 08-29-2007   #4 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, INDIA
Posts: 18,411
Thats weird. I will look into this. AFAIK, rm -rf removes folders and subfolders instantly.
__________________
New Users: Read This First


devils casper is offline   Reply With Quote
Old 08-29-2007   #5 (permalink)
Just Joined!
 
Join Date: Aug 2007
Posts: 3
Hi Yea, When I tried your method it just said "directory does not exist", because .svn wasn't in the root, it was in every other directory below it.

Using the method I found, it did a search for all the .svn within all directories, then deleted them and the files.

I tried for hours messing about with rm -rf [options] and I wasnt getting anywhere, hence why I posted here

Thanks for your quick reply though, much appreciated, it led me to finding another solution.

I will no doubt be trying to pick your brains on other topics if you don't mind
stuartb is offline   Reply With Quote
Old 08-29-2007   #6 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, INDIA
Posts: 18,411
You are most welcome to ask for suggestion at any time.
I think problem was directory path only.
__________________
New Users: Read This First


devils casper is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question bluesguy Debian Linux Help 1 12-08-2006 07:53 AM
apt 4 suse skiman SuSE Linux Help 4 11-24-2005 07:37 PM
Installation problem satimis Misc 2 09-30-2005 02:52 AM
Cannot uninstall wxWidgets - suse 9.1 brainspasm SuSE Linux Help 0 04-04-2005 12:36 PM
help installing superkaramba ultrA_Cowboy Installation 13 02-26-2005 09:22 PM

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 02:35 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0