How to clean up directories

How to clean up directories

Post by Bertram Ludaesche » Wed, 09 Oct 1996 04:00:00



I'm using the following command once in a while to 'clean and
compress' my subdirs:

find . \( -name core -o -name '*~' -o -name '.*~' -o -name '\#*\#' \)
-print -exec rm \{\} \; , -name '*.ps' -print -exec gzip -9 \{\} \;

it removes cores, deletes temporary or backup files and compresses
postscript files.

How can I extend this, to *exclude* certain directories, e.g. the
netscape cache directories, where I don't want to compress or delete
files!?

        =BL

--

 
 
 

How to clean up directories

Post by Hagen Ro » Wed, 09 Oct 1996 04:00:00



Quote:> I'm using the following command once in a while to 'clean and
> compress' my subdirs:
> find . \( -name core -o -name '*~' -o -name '.*~' -o -name '\#*\#' \)
> -print -exec rm \{\} \; , -name '*.ps' -print -exec gzip -9 \{\} \;
> How can I extend this, to *exclude* certain directories, e.g. the
> netscape cache directories, where I don't want to compress or delete
> files!?

 find . \
 \( -name .Netscape-cache -prune \) -o \
 \( -name RCS -prune \) -o \
 \( -name core -o -name '*~' -o -name '.*~' -o -name '\#*\#' \) \
 -print -exec rm \{\} \; \
 -name '*.ps' -print -exec gzip -9 \{\} \;

--
 Hagen Ross                           Alfred-Wegener-Institut f"ur

 phone: +49 471 4831 496              D27515 Bremerhaven