LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2011, 07:57 PM   #1
ewc111
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
How do you erase Dir in root I have over three hundred to do


I have over three hundred directories in root that needs to be erased How do you do this in quantity ?
 
Old 12-12-2011, 08:04 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Could I ask why you stored this many directories under root? And to make it easier, you could run your file manager as root, and do it like so. Also, from the command line, if many directories start with the same first few characters, you could use wildcards. Using the interactive argument with rm could be an option too.
 
1 members found this post helpful.
Old 12-12-2011, 08:33 PM   #3
coolsg5636
Member
 
Registered: Sep 2011
Location: Pune,India
Distribution: RHEL ,CentOS, Fedora
Posts: 100

Rep: Reputation: 25
Hi,

You can use following command if your directory listing is like dir0,1,2....

#rm -rf dir*
 
1 members found this post helpful.
Old 12-13-2011, 12:05 AM   #4
ewc111
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
I have over three hundred directories in root that needs to be erased How do you do this in quantity

To answer your question I used photorec in order recoup some lost files. It worked and they where recouped in root. Follow up question how do you enter a file manager in root?
 
Old 12-13-2011, 12:17 AM   #5
linuxmen
Member
 
Registered: Aug 2011
Distribution: fedora14,11, RHEL5, CentOS6, win2008R2, Win7
Posts: 45

Rep: Reputation: 4
Always double check bafore using "rm -rf" command....
 
1 members found this post helpful.
Old 12-13-2011, 12:23 AM   #6
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by ewc111 View Post
To answer your question I used photorec in order recoup some lost files. It worked and they where recouped in root. Follow up question how do you enter a file manager in root?
If you are using Ubuntu on this machine, and if I am correct that Ubuntu uses nautilus
Code:
sudo nautilus
Will open nautilus up with root privileges. Allowing you to delete the directories as you normally would with nautilus.
 
1 members found this post helpful.
  


Reply


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
Web Root Dir Change and New Dir Added issue in CentOS 5 Ginnyz Linux - Server 2 06-01-2009 08:29 PM
how to erase files owned by root? maiden2 Linux - Newbie 6 12-22-2007 07:44 PM
Can't delete a dir!?!?! Even as root??? yanik Linux - Software 9 07-05-2007 01:41 AM
What happens when root dir fills up? leiavoia Debian 5 11-14-2004 07:14 PM
cant resize root thru rescue, auto mounts root dir absolutal Linux - Newbie 0 06-18-2003 03:06 PM


All times are GMT -5. The time now is 04:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration