From owner-freebsd-isp Fri Feb 21 19:47:06 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id TAA17647 for isp-outgoing; Fri, 21 Feb 1997 19:47:06 -0800 (PST) Received: from packfish.gateway.net.hk (john@packfish.gateway.net.hk [202.76.19.16]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA17641 for ; Fri, 21 Feb 1997 19:47:02 -0800 (PST) Received: (from john@localhost) by packfish.gateway.net.hk (8.8.3/8.7.3) id LAA18443; Sat, 22 Feb 1997 11:47:35 +0800 (HKT) Date: Sat, 22 Feb 1997 11:47:35 +0800 (HKT) From: John Beukema To: "R. A. Nethercott" cc: David Stickney , "'FBSD ISP'" Subject: Re: Big Directories.. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-isp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 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 > >