From: Lloyd Zusman <ljz@asfast.com>
To: zsh-users@sunsite.dk
Subject: Re: listing/deleting empty directories recursively
Date: Sat, 19 Nov 2005 09:39:32 -0500 [thread overview]
Message-ID: <m3fypsog63.fsf@asfast.com> (raw)
In-Reply-To: <103un195cji6u17l0kj1ijkvfj2vn9o3r5@4ax.com>
zzapper <david@tvis.co.uk> writes:
> 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.
How about this?
print **/*(/^F) | xargs -n1 -t rmdir
The xargs command dates back to something like 1977, in the infancy of
Unix. It's still quite useful for tasks such as this one.
--
Lloyd Zusman
ljz@asfast.com
God bless you.
next prev parent reply other threads:[~2005-11-19 14:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-19 9:19 zzapper
2005-11-19 9:57 ` Christian Taylor
2005-11-19 11:28 ` zzapper
2005-11-19 11:56 ` Thor Andreassen
2005-11-19 11:59 ` Thor Andreassen
2005-11-19 12:48 ` Christian Taylor
2005-11-19 14:54 ` Thorsten Kampe
2005-11-19 15:59 ` Stephane Chazelas
2005-11-19 14:39 ` Lloyd Zusman [this message]
2005-11-19 16:09 ` Bart Schaefer
2005-11-19 17:07 ` zzapper
2005-11-19 19:39 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
2005-11-18 19:49 zzapper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3fypsog63.fsf@asfast.com \
--to=ljz@asfast.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).