?
Solved

Remove Directory With Infinite Sub Directories

Posted on 1999-07-27
7
Medium Priority
?
3,212 Views
Last Modified: 2013-12-23
Without having to reformat the harddisk, how can i remove a directory with subdirectories, for example m/m/m/m/m/m/m/m............/m/m/m/m/m (more than 300 levels)?

Thanks.
0
Comment
Question by:aimui
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1583923
rm -r
0
 

Author Comment

by:aimui
ID: 1583924
I have used this command but i get the error message : File name too long!
0
 
LVL 2

Expert Comment

by:helver
ID: 1583925
Try going halfway down the tree and running the command ozo gave you.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:n0thing
ID: 1583926
There's a few ways to do this.
1- You could find the inode of the dir and write a little
C program or perl to unlink the inode.
2- Try to do a find with the -exec rm arg, not sure this
will work. find will recurse into the subdir and hopefully
the -exec rm args will work at these sub levels.
3- mv dirname /dev/null - Not sure if this work. :))

0
 
LVL 5

Accepted Solution

by:
tfabian earned 400 total points
ID: 1583927
from the top level directory


  rm -R directory name

the -R should be in capital letters


0
 
LVL 1

Expert Comment

by:toTo
ID: 1583928
while test -d m; do cd m; done
cd ..
while test -d m; do rmdir m; cd ..; done
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6826392
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  Or if you are an EE Pro user, click the link below to select open items for your Member ID using Power Search:
http://www.experts-exchange.com/jsp/qPowerSearch.jsp.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Make the most of your online learning experience.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question