linux find command study

itpremier發表於2011-01-29

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

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/350519/viewspace-1045348/,如需轉載,請註明出處,否則將追究法律責任。

相關文章