In Linux, how do I find find directory with the most subdirectories or files? -


how can find directory largest number of files/subdirectories in on system? clever answer /, that's not i'm looking for.

i’ve been told filesystem out of nodes, suspect somewhere there lot of files/directories garbage, , want find them.

i’ve tried running this:

$ find /home/user -type d -print | wc -l 

to find specific directories.

starting current directory, try

find . -type d | cut -d/ -f 2 | uniq -c 

this list directories starting current one, split each line character "/", select field number "2" (each line starts "./", first field ".") , outputs unique lines, , count how unique line appears (-c parameter).

you add "sort -g" @ end.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -