On 4/19/23 21:23, Dale wrote:
Mark Knecht wrote:
> I wonder. Is there a way to find out the smallest size file in a
directory or sub directory, largest files, then maybe a average file
size??? I thought about du but given the number of files I have here,
it would be a really HUGE list of files. Could take hours or more
too. This is what KDE properties shows.
I'm sure there are more accurate ways but
sudo ls -R / | wc
give you the number of lines returned from the ls command. It's not
perfect as there are blank lines in the ls but it's a start.
My desktop machine has about 2.2M files.
Again, there are going to be folks who can tell you how to remove
blank lines and other cruft but it's a start.
Only takes a minute to run on my Ryzen 9 5950X. YMMV.
I did a right click on the directory in Dolphin and selected
properties. It told me there is a little over 55,000 files. Some 1,100
directories, not sure if directories use inodes or not. Basically, there
is a little over 56,000 somethings on that file system. I was curious
what the smallest file is and the largest. No idea how to find that
really. Even du separates by directory not individual files regardless
of directory. At least the way I use it anyway.
If I ever have to move things around again, I'll likely start a thread
just for figuring out the setting for inodes. I'll likely know more
about the number of files too.
Dale
:-) :-)
If you do not mind using graphical solutions, Filelight can help you
easily visualize where your largest directories and files are residing.
https://packages.gentoo.org/packages/kde-apps/filelight
Visualise disk usage with interactive map of concentric, segmented rings
Eric