1 Answer 1

3

Perhaps

find path/to/directory/ -type f -size +100M -printf 1 | wc -c

Or, if you want to limit the search to the top level directory only (without descending into subdirectories)

find path/to/directory/ -maxdepth 1 -type f -size +100M -printf 1 | wc -c
2
  • $ find /tmp/ -maxdepth 1 -type f -print | wc -l
    – mirekphd
    Commented May 18, 2022 at 8:59
  • 1
    @mirekphd find ... -printf 1 | wc -c is preferred over find ... -print | wc -l because the latter will miscount files whose names contain newlines Commented May 18, 2022 at 11:45

Not the answer you're looking for? Browse other questions tagged .