![Linux Shell Scripting Cookbook(Third Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/161/36701161/b_36701161.jpg)
上QQ阅读APP看书,第一时间看更新
Searching based on file size
Based on the file sizes of the files, a search can be performed:
# Files having size greater than 2 kilobytes $ find . -type f -size +2k # Files having size less than 2 kilobytes $ find . -type f -size -2k # Files having size 2 kilobytes $ find . -type f -size 2k
Instead of k, we can use these different size units:
- b: 512 byte blocks
- c: Bytes
- w: Two-byte words
- k: Kilobytes (1,024 bytes)
- M: Megabytes (1,024 kilobytes)
- G: Gigabytes (1,024 megabytes)