Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Feb 1997 11:47:35 +0800 (HKT)
From:      John Beukema <john@packfish.gateway.net.hk>
To:        "R. A. Nethercott" <rnet@tchnet.tchnet.com>
Cc:        David Stickney <david@wvb.gomel.by>, "'FBSD ISP'" <freebsd-isp@freebsd.org>
Subject:   Re: Big Directories..
Message-ID:  <Pine.BSI.3.91.970222113447.17593A-100000@packfish.gateway.net.hk>
In-Reply-To: <Pine.BSF.3.91.970221150019.25856A-100000@tchnet.tchnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
rm -r works by creating a command line with all the subdirectories 
included, ie. in effect rmdir x/x/x rmdir x/x rm x.
This fails when the maximum command line length is reached.  

One way to remove them is to write a shell that does the opposite of the
shell that wrote them. 

in psuedo code

while no error 
cd x;
end while
cd ..
while no error
rmdir x
cd ..
end while

This may take as much as several hours so put an echo statement in to 
follow the progress.

Kick the user off the system.

jbeukema

On Fri, 21 Feb 1997, R. A. Nethercott wrote:

> On Fri, 21 Feb 1997, David Stickney wrote:
> 
> > I some questions, that nobody can seem to answer
> > 
> > while : ; do
> >      mkdir x
> >      cd x
> > done
> > 
> > 1. How can you prevent users from running this in their home directory, 
> > without cutting off their shell account
> > 2. How can you get rid of the directory once it has 300 or so 
> > subdirectories. The shell keeps saying there is no such directory, and 
> > nothing seems to delete it. I tried moving it to a floppy, but it worked 
> > for 45 minutes and I didn't want to burn out the drive.
> > 
> > As Always, If you send your address with your answer, I'll send you 20 
> > Soviet Roubles,
> > 
> > Thanks for reading,...
> > Dave
> 
> Ok, just as a warning, this will be the first time I have answered a 
> question here...so correct me if I am wrong.  =)
> 
> I think a simple rm -R <dir name goes here> should work.
> 
> As for the first part, I dont think there is a way to not let a sh user 
> to not make directories in his/her home dir.  Perhaps a rsh?
> 
> Roy
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.91.970222113447.17593A-100000>