linuxfind命令按照文件大小搜索的注意事项


[root@localhost ~]# man find

-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)
#这是默认单位,如果单位为b或不写单位,则按照 512Byte搜索
'c' for bytes
#搜索单位是c,按照字节搜索
'w' for two-byte words
#搜索单位是w,按照双字节(中文)搜索
'k'for Kilobytes (units of 1024 bytes)
#按照KB单位搜索,必须是小写的k
'M' for Megabytes (units of 1048576 bytes)
#按照MB单位搜索,必须是大写的M
'G' for Gigabytes (units of 1073741824 bytes)
#按照GB单位搜索,必须是大写的G

也就是说如果要按照字节来进行搜索,则需要加上“c”

[root@localhost ~]# find.-size 1207c
./anaconda-ks.cfg
#使用搜索单位c,才会按照字节搜索

猜你喜欢

转载自www.cnblogs.com/bky-lwyh930214/p/10211813.html
今日推荐