You've explicitly asked find
to search for files (-type f
), and when you find one, you've asked it to execute ls -lS
on it. You can't even fix this with the GNU find extension of +
to pass more than one matching file at a time, as there may (likely) be too many files to pass to ls
at once.
Instead, using GNU find, ask it to print the size of the file and the filename, then pass it to sort
, all null-delimited.
find /usr -type f -printf "%s %p\n\0"|sort -zn
Sample output:
0 /usr/lib/python2.7/dist-packages/pkg_resources/_vendor/__init__.py
0 /usr/lib/python2.7/dist-packages/python_debian-0.1.30.egg-info/requires.txt
0 /usr/lib/python2.7/email/mime/__init__.py
... output omitted ...
24013304 /usr/lib/gcc/i686-linux-gnu/6/cc1plus
25675008 /usr/lib/i386-linux-gnu/libicudata.so.57.1
49547156 /usr/lib/i386-linux-gnu/libLLVM-3.9.so.1