cleaning a directory

Ray Lubinsky rwl at uvacs.cs.Virginia.EDU
Sun Mar 26 03:04:01 AEST 1989


In article <4218 at omepd.UUCP>, merlyn at intelob.intel.com (Randal L. Schwartz @ Stonehenge) writes:
>    $deadmeat=`pwd`
>    cd /
>    rm -rf $deadmeat
>    mkdir $deadmeat
>    chmod $someprotection $deadmeat
> 
> No big deal.  No passing of arguments to rm, and no need to worry
> about .* files and files containing spaces and returns (yup, it's
> pathological, but I worry sometimes...).

Another advantage to your method is that sometimes directory files get quite
large if they have had a large number of filenames within them.  Removing and
recreating the directory itself will let you pare down the directory file to
the smallest size possible.

x

-- 
| Ray Lubinsky                         rwl at trinity.cs.virginia.edu (Internet) |
|                                      rwl at virginia                  (BITnet) |
| Department of Computer Science,      ...!uunet!virginia!uvacs!rwl    (UUCP) |
| University of Virginia               (804) 979-6188                 (voice) |



More information about the Comp.unix.questions mailing list