GNU bug report logs - #12675
find RFE test verb "-inodes"

Previous Next

Package: coreutils;

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

From: Bob Proulx <bob <at> proulx.com>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: 12675 <at> debbugs.gnu.org
Subject: bug#12675: find RFE test verb "-inodes"
Date: Thu, 18 Oct 2012 11:17:21 -0600
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.
> 
> 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...

Do you mean something like find -empty?

 -- Test: -empty
     True if the file is empty and is either a regular file or a
     directory.  This might help determine good candidates for
     deletion.  This test is useful with `-depth' (*note Directories::)
     and `-delete' (*note Single File::).

Example:

  $ find . -empty

Bob




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.