Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: listing/deleting empty directories recursively
- X-seq: zsh-users 9694
- From: Thor Andreassen <ta@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: listing/deleting empty directories recursively
- Date: Sat, 19 Nov 2005 12:56:53 +0100
- In-reply-to: <103un195cji6u17l0kj1ijkvfj2vn9o3r5@xxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <tfrtn1dt9nf26m1rka6b9kg3bmcoa2evs4@xxxxxxx> <200511191057.25776.cht@xxxxxxxxx> <103un195cji6u17l0kj1ijkvfj2vn9o3r5@xxxxxxx>
On Sat, Nov 19, 2005 at 11:28:15AM +0000, zzapper wrote:
> On Sat, 19 Nov 2005 10:57:25 +0100, wrote:
>
> >> ls -ld *(/^F)
> >>
> >> Will list any empty directories, but only for one level of subdirectories,
> >> how to make it delete empty directories at any level.
> >
> >ls -ld **/*(/^F)
> >(will list empty directories at any level in the current working directory)
> >
> >Christian
> Thanx works just dandy,
> Now I'd like to rm those directories, and log which ones were deleted.
This should do the trick:
for dir in `ls -ld **/*(/^F)`; do echo $dir > LOGFILE; rmdir $dir; done
--
mvh
Thor Andreassen
Messages sorted by:
Reverse Date,
Date,
Thread,
Author