The find command in linux is used to find files. manfind can be used to find files that are omnipotent. Therefore, simply find the file according to the file size. Search for size from manfind and you can see the following information:-sizen [cwbkMG] Fileusesnunitsofspace. Thefollowingsuffixescanbeused: bfor512-bytebloc
The find command in linux is used to find files. man find can be used to find files that are omnipotent. Therefore, simply find the file according to the file size. Search for the size from man find. the following information is displayed:
-size n[cwbkMG] File uses n units of space. The following suffixes can be used: b for 512-byte blocks (this is the default if no suffix is used) c for bytes w for two-byte words k for Kilobytes (units of 1024 bytes) M for Megabytes (units of 1048576 bytes) G for Gigabytes (units of 1073741824 bytes)
Note:The default unit is B, which represents 512 bytes.So 2 indicates 1 K, and 1 M indicates 2048. if you do not want to convert it yourself, you can use other units, such as c, K, and M.
Example: find the file in the current directory with a size of 2048 (2 k) bytes
Find./-size 4 or find./-size 2048c or find./-size 2 K
If the above search file is equal to the specified size, can you query a file greater than or less than a specified value? the answer is yes, for example:
Search for files larger than 2 k,+ Indicates that the value is greaterFind./-size + 2048c find files smaller than 2 k,-Indicates lessFind./-size + 2048c-type f