Now I find that wc -c could show the size of file, then how to select them and list them? It should be a single pipeline of commands.
Asked
Active
Viewed 2,784 times
0
1 Answers
3
find
will be better:
find . -type f -size +9999999c
Replace .
with the directory.
-
Modified to also print the file sizes in bytes and sorted by file size (largest files first):
find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr
– Freddy Feb 11 '19 at 15:16
wc
to find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory. – Kusalananda Feb 11 '19 at 15:04du -b
does the same aswc -c
(output in bytes). – Freddy Feb 11 '19 at 15:08