Summary :Unable to delete recursive directory structure using rm -r .. ........ gives permission denied

From: <r.rekha_at_iflexsolutions.com>
Date: Thu, 14 Jun 2001 11:54:50 +0530

Hi all,

        My sincere thanks to all who replied. Ultimately James Sainsbury's
script did the magic for me.
        For those of you who want to go through the script, read through the
mail below.
        He has also explained how the script works by giving a simple
example.

        Thanks again.

Note : This list is no doubt the best.

Regards,
Rekha

The only true wisdom is in knowing you know nothing


-----Original Message-----
From: James Sainsbury [mailto:sainsb_j_at_chem.usyd.edu.au]
Sent: Wednesday, 13 June, 2001 11:20 AM
To: r.rekha_at_iflexsolutions.com
Subject: Re: FW: Unable to delete recursive directory structure using rm
-r .. ........ gives permission denied


On Wed, 13 Jun 2001 r.rekha_at_iflexsolutions.com wrote:


Tried chopping the tree from the base?
eg
        cd simsgs/test
        mv I97001/O97002 .
        rmdir I97001
        mv O97002/I97002 .
        rmdir I97002
        etc etc

Scripted something like this:

        #! /bin/sh

        i=1
        
        IDIR=`printf 'I97%03d' $i`
        while [ $i -lt 500 ]
        do
                ODIR=`printf 'O97%03d' $i`
                mv $IDIR/$ODIR .
                rmdir $IDIR
                i=`expr $i + 1`
                IDIR=`printf 'I97%03d' $i`
                mv $ODIR/$IDIR .
                rmdir $ODIR
        done



------ vivre en paix, joye, sante, faisans tousjours grande chere.------
James Sainsbury J.Sainsbury_at_Chem.USyd.EDU.AU
Computer System Manager +61 2 9351 4415 [w]
Room 2.40 Building F11 +61 2 9351 3329 [f]
School of Chemistry +61 2 8904 9005 [h]
University of Sydney 0407 743 446 [m]

> Thank you all for your swift replies.
>
> Tried all your solutions but to no avail. chown gives me path too long
> messages.
> chmod -R 777 works fine but i still get the "permission denied" message.
>
> I just tried getting into the sub-directories, somewhere around 80 to 90
> down the line and then fired ls -l and found that root is no more the
owner.
> ls -l gives me "127" in the place of user id.
> After a series of cd commands to the sub-directories, the cd command hangs
> for sometime and comes out with "no space" error.
> pwd gives me read error.
>
> I am also enclosing the file which contains the "rm -r" error sequence.
>
> I have almost dug into about 200 sub-directories. Its just impossible for
me
> to get in more deep.
> Kindly help me out.
>
> <<telnet.log>> This log file shows only about 74 sub-directories, but
> there are many many more to go.
>
> Regards,
> Rekha
>
> The only true wisdom is in knowing you know nothing
>
> > -----Original Message-----
> > From: Rekha Raghavan-RT
> > Sent: Tuesday, 12 June, 2001 6:15 PM
> > To: 'tru64-unix-managers_at_ornl.gov'
> > Subject: Unable to delete recursive directory structure using rm -r
> > .......... gives permission denied
> >
> > Hi all,
> >
> > I have a Digital Unix V4.0 F box.
> > I have been trying to delete (logged in as root) a directory which
> > has thousands of sub-directories under it without any data.
> > Root owns this directory, but i am still unable to delete. Using "
> > rm -r * " gives me a strict "Permission Denied" message for every
> > recursive directory.
> > Is there any other way to wipe this off???
> > Also, kindly let me know why such a message appears even though
> > i(root) own this directory.
> >
> > Regards,
> > Rekha
> >
> > The only true wisdom is in knowing you know nothing
> >
>
Received on Thu Jun 14 2001 - 06:22:31 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:42 NZDT