[WBEL-users] RE: File deletion

Frederick Kern frederick_kern@hotmail.com
Thu Jan 20 07:21:16 CST 2005


>Subject: [WBEL-users] File deletion
>
>Hi everyone
>
>I have to somehow or other clean out a filesystem in order to start
>again for this year.
>
>These folders are a main folder for a Branch Office, with nested
>subfolders for various safety test certificates that have to be scanned
>and stored.  There are about 500 of the main Branch Office folders!

1) cd to the "main folder for a Branch Office"
2) find . -type f -exec rm {} \;

>What I need to do is to remove the files but leave the directories intact.
>
>Is it possible to use a script to do this?  If so, how?  I realise rm
>-rf removes subdirectories as well as files!

If the folders are only one deep, you could:
1) cd to the "main folder for a Branch Office"
2) rm */*

Mind you symlinks will also be delete and you will get warning messages
saying that rm is ignoring directories.

>The files are kept on a Windows box but I have copied them over to one
>of my WBEL servers because I could not imagine any way of doing this in
>Windows.
>
>I realise this is not a WBEL issue as such but any help would be
>appreciated.
>
>Thanks.
>
>Francies

~Fred





More information about the Whitebox-users mailing list