GNU bug report logs -
#12675
find RFE test verb "-inodes"
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Thu, 18 Oct 2012 16:43:01 UTC
Severity: normal
Tags: notabug
Done: Eric Blake <eblake <at> redhat.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 18 Oct 2012 11:23:03 -0600
with message-id <50803AF7.3020903 <at> redhat.com>
and subject line Re: bug#12675: find RFE test verb "-inodes"
has caused the debbugs.gnu.org bug report #12675,
regarding find RFE test verb "-inodes"
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
12675: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12675
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
A useful thing to be a test on the number of non-structural entries in a
directory.
By non structural, it would work like ls -A, and not include entries
that are
part of the directory structure like "." and ".." -- with the idea of being
able to quickly determine if a directory is empty.
Maybe 'inodes' with standard +/- adjectives
So "find . -type d -inodes 0" would find all the empty dirs.
Unless, of course this is already in there and I've missed it... but
didn't see anything that would provide this w/o calling an external func
on each dir...which really slows things down...
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
tag 12675 notabug
thanks
On 10/18/2012 10:41 AM, Linda Walsh wrote:
> A useful thing to be a test on the number of non-structural entries in a
> directory.
>
> By non structural, it would work like ls -A, and not include entries
> that are
> part of the directory structure like "." and ".." -- with the idea of being
> able to quickly determine if a directory is empty.
So which do you really want - to know how many directory entries exist,
or to just know if a directory is (non-)empty? The former would be a
new feature, while the latter already exists as a GNU find extension.
>
> Maybe 'inodes' with standard +/- adjectives
>
> So "find . -type d -inodes 0" would find all the empty dirs.
>
> Unless, of course this is already in there and I've missed it... but
> didn't see anything that would provide this w/o calling an external func
> on each dir...which really slows things down...
Sorry, but you've reached the wrong list. GNU coreutils does not
maintain find(1); for that, you'd need to write to the findutils list.
But while you are correct that POSIX does not provide this capability,
GNU find already does what you want:
find -type d -empty
--
Eric Blake eblake <at> redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 12 years and 277 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.