On 2/8/23 20:56, SCOTT FIELDS via GNU coreutils General Discussion wrote:
I'm wanting to get a per directory inode report.
The problem I have with "du -inodes" is that the inode report for a directory
includes all inodes for subdirectories.
But...if I use "-S" the subdirectory entry itself isn't reported in the given
directory.
So...say I have a directory with 1000 subdirectories, but each subdirectory
only contains may 5 files, I'll get a response like this:
"du -inodes <directory>" report all the inodes in <directory, but also all the
inodes in the subdirectories (including the subdirectory itself).
While...if I run "du -inodes -S <directory>", <directory> will only report the
non-directory file references and non of the direct subdirectories (minus the contents of those
subdirectories).
Is there a command use I'm missing that will show be all directories with their
total first level entries count, only?
As there's no reproducer / example, I'm quite bit confused what is the point.
Maybe you want to try a combination with -d?
-d, --max-depth=N print the total for a directory (or file, with --all)
only if it is N or fewer levels below the command
line argument; --max-depth=0 is the same as
--summarize
Have a nice day,
Berny