Re: Could we have a flag to tell us which directories were actually remo
From:
Jim Meyering
Subject:
Re: Could we have a flag to tell us which directories were actually removed?
Date:
Thu, 16 Aug 2007 11:56:35 +0200
Andreas Schwab <address@hidden> wrote:
> Reuben Thomas <address@hidden> writes:
>
>> In this case, I don't see a good way of getting the same information. The
>> best way I could come up with that was short enough for command-line use
>> was use find to find directories with only 2 symlinks to them, but of
>> course that only works on some filing systems.
>
> $ find -type d -empty
Note that if you simply want to remove all empty directories
(including e.g., those rendered empty by removing leaf dirs),
you should also use -depth and -delete:
find . -depth -type d -empty -delete
Though, the -delete predicate is provided by GNU find,
it is not specified by POSIX.