by default , find command use 512 byte as one size unit, and file size will round up to times of 512 bytes.
See below and think .
If you encounter trouble at default size unit, please use suffix "c" or "k" for exactly file size match.
[oracle@tomy_4 test]$ find ./ -size 13c -ls
133975 0 lrwxrwxrwx 1 oracle oinstall 13 Sep 5 2009 ./me3 -> /boot/message
[oracle@tomy_4 test]$ find ./ -size 6c -ls
133963 4 -rw-rw-rw- 1 oracle oinstall 6 Sep 5 2009 ./a
[oracle@tomy_4 test]$ find ./ -size 2 -ls
133971 4 -rw-r--r-- 1 oracle oinstall 891 Sep 5 2009 ./c.abc
133960 4 -rw-r--r-- 1 oracle oinstall 891 Sep 5 2009 ./king.ini
133948 4 -rw-r--r-- 1 oracle oinstall 891 Sep 5 2009 ./c
[oracle@tomy_4 test]$ find ./ -size +2 -ls
133958 4 drwxr-xr-x 2 oracle oinstall 4096 Sep 5 2009 ./
133961 8 -rw-r--r-- 1 oracle oinstall 8192 Sep 5 2009 ./users.1
133967 24 -rw-r--r-- 1 oracle oinstall 23108 Sep 5 2009 ./me2
[oracle@tomy_4 test]$ find ./ -size -2 -ls
133975 0 lrwxrwxrwx 1 oracle oinstall 13 Sep 5 2009 ./me3 -> /boot/message
133963 4 -rw-rw-rw- 1 oracle oinstall 6 Sep 5 2009 ./a
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/350519/viewspace-1045348/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/350519/viewspace-1045348/
本文介绍了如何使用find命令进行精确的文件大小匹配。默认情况下,find命令使用512字节作为单位,并将文件大小向上取整到512字节的倍数。若需精确匹配文件大小,则需使用c或k作为单位。
8570

被折叠的 条评论
为什么被折叠?



