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.
1 Answer
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 -nrFreddy– Freddy2019-02-11 15:16:39 +00:00Commented Feb 11, 2019 at 15:16
wcto 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.du -bdoes the same aswc -c(output in bytes).