Skip to content

Instantly share code, notes, and snippets.

@aculich
Created August 17, 2016 21:02
Show Gist options
  • Select an option

  • Save aculich/5967df09ae883679338d32373fcf56bc to your computer and use it in GitHub Desktop.

Select an option

Save aculich/5967df09ae883679338d32373fcf56bc to your computer and use it in GitHub Desktop.
quick way to count up files of different sizes
#!/bin/bash
cd /path/to/files
find . -type f | wc -l
find . -type f -size +1M | wc -l
find . -type f -size +10M | wc -l
find . -type f -size +1G | wc -l
find . -type f -size +10G | wc -l
### or, the quick one-liner way:
for size in +0 +1M +10M +1G +10G ; do echo -ne "$size\t"; find . -type f -size $size | wc -l; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment