Wit the following command I can find largest directory.
find <directory> -printf '%s %p\n' |sort -nr | head
But is there a way to find largest file within all the subdirectories in directory ?
Wit the following command I can find largest directory.
find <directory> -printf '%s %p\n' |sort -nr | head
But is there a way to find largest file within all the subdirectories in directory ?
Specify -type f
for file:
find -type f -printf '%s %p\n' |sort -nr | head
With the command you just gave, you get the largest file. If you want to summarize the size for each file recursively for directories you may want to use the `du' command.