0

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.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
ArTyNKB
  • 1
  • 2
  • Also [web search](https://duckduckgo.com/?q=site%3Aunix.stackexchange.com+find+files+bigger+larger+better&atb=v142-7__&ia=web) – Kusalananda Feb 11 '19 at 15:01
  • Note that using `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:04
  • Better use the faster "du" command instead of "wc". `du -b` does the same as `wc -c` (output in bytes). – Freddy Feb 11 '19 at 15:08
  • Related: [grep search for any number in a range](https://unix.stackexchange.com/questions/244140/grep-search-for-any-number-in-a-range) – Mark Plotnick Feb 11 '19 at 17:50

1 Answers1

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