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.

4
  • Also web search Commented Feb 11, 2019 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. Commented Feb 11, 2019 at 15:04
  • Better use the faster "du" command instead of "wc". du -b does the same as wc -c (output in bytes). Commented Feb 11, 2019 at 15:08
  • Related: grep search for any number in a range Commented Feb 11, 2019 at 17:50

1 Answer 1

3

find will be better:

find . -type f -size +9999999c

Replace . with the directory.

1
  • 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 Commented Feb 11, 2019 at 15:16

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.