Reputation: 25
What do I need to do if I want to list all the files (not directories) and their size, with their sizes sorted from largest to smallest? I tried find . -type f -exec ls -Shl {} \;
but it does list the files in order (of their size). Anyone can help??
Upvotes: 2
Views: 16436
Reputation: 361595
Use +
instead of \;
.
find . -type f -exec ls -Shl {} +
\;
calls ls once per file whereas +
calls it a single time with all the matched file names.
Upvotes: 10