let's say I have a directory like this:
IIS1
IIS1-DVLP
FS
IIS1.zip
IIS1-DVLP.zip
RA.zip
the top 3 entries are folders, the bottom 3 entries are zip files.
If I now want to delete IIS1
and IIS1.zip
I tried the following:
admin@Server:/volumeUSB1/usbshare1-2$ find -name "IIS1" -o -name "IIS1.zip"
./IIS1
./IIS1.zip
which found me the things I want to delete, so I simply thought I can add my -delete
admin@Server:/volumeUSB1/usbshare1-2$ find -name "IIS1" -o -name "IIS1.zip" -delete
admin@Server:/volumeUSB1/usbshare1-2$ ls -l
total 1
drwxrwxrwx 1 admin users 0 Feb 11 14:03 IIS1
drwxrwxrwx 1 admin users 0 Feb 11 14:03 IIS1-DVLP
-rwxrwxrwx 1 admin users 164 Feb 11 14:03 IIS1-DVLP.zip
but my folder somehow survived!
How would I do it in this case? I can't use a Wildcard *
because IIS1-DVLP
would also match that wildcard
This folder only has subfolders or zip files in it. either both things exist (like as for IIS1
) or only a folder or only a zip file. I want to be able to delete whatever exists.