You are not logged in.

#26 2018-06-14 11:33:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: sorting script output ...

Ah, yes, -delete can delete a directory and all of it's contents, but only if all of the contents also match the critieria.  Progandy, it would be nonsense if it was incapable of doing this.

So -delete can do this, just not with the other options currently in play.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#27 2018-06-14 13:11:41

jjb2016
Member
From: Oxfordshire
Registered: 2016-02-29
Posts: 73

Re: sorting script output ...

find /mnt/seagate/ -maxdepth 1 -mtime +10 -regextype 'posix-minimal-basic' -type d ! -path /mnt/seagate -regex '.*/20[0-9]\{2\}-[0-9][0-9]-[0-9][0-9]$' -exec echo rm -r {} +

gives me the fizz ...

Seriously though - thanks a lot for the tips guys, and for not getting too high-and-mighty (like some other forums I've used).  You have shone a light on some new learning paths for me.

Offline

Board footer

Powered by FluxBB