I almost reached my limit for the number of files allowed in the Linux home directory, and I'm curious where all the files are.
In any directory, I can use, for example, find . -type f | wc -l find . -type f | wc -l find . -type f | wc -l to show the number of files in this directory and its subdirectories, but I would like to be able to generate a complete list of all subdirectories (and subdirectories, etc.), each of which contains count of all the files contained in it , and its subdirectories - if possible, evaluated by account, in descending order.
For example, if my file structure looks like this:
Home/ file1.txt file2.txt Docs/ file3.txt Notes/ file4.txt file5.txt Queries/ file6.txt Photos/ file7.jpg
The result will be something like this:
7 Home 4 Home/Docs 2 Home/Docs/Notes 1 Home/Docs/Queries 1 Home/Photos
Any suggestions are greatly appreciated. (Also a quick explanation of the answer so that I can learn from this!). Thanks.
Richard Inglis
source share