出于某种原因,find
似乎不接受千字节前缀:
T42 ~ # find /root/ /home/noc/ \( -type f -size -1k \) -exec grep -iH hangup {} \;
find: `/home/noc/.gvfs': Permission denied
T42 ~ # find /root/ /home/noc/ \( -type f -size -1000 \) -exec grep -iH hangup {} \;
/root/minicom.log:20130524 17:31:22 Hangup (0:00:00)
/root/minicom.log:20130528 14:49:39 Hangup (0:00:00)
/root/minicom.log:20130806 09:55:39 Hangup (0:00:00)
/root/minicom.log:20130806 09:55:43 Hangup (0:00:00)
/root/minicom.log:20130918 13:58:38 Hangup (0:00:00)
/root/minicom.log:20130918 13:58:38 Hangup (0:00:00)
/root/minicom.log:20131017 10:36:24 Hangup (0:00:00)
/root/minicom.log:20131017 12:44:28 Hangup (0:00:00)
/root/minicom.log:20131017 12:49:00 Hangup (0:00:00)
/root/minicom.log:20131017 12:49:00 Hangup (0:00:00)
/root/minicom.log:20131017 17:11:45 Hangup (0:00:00)
/root/minicom.log:20131017 17:11:45 Hangup (0:00:00)
/root/minicom.log:20131114 18:16:26 Hangup (0:00:00)
/root/minicom.log:20131216 12:36:34 Hangup (0:00:00)
/root/minicom.log:20131217 12:27:52 Hangup (0:00:00)
find: `/home/noc/.gvfs': Permission denied
/home/noc/gnupg/gnupg-2.0.20/g10/cpr.c: raise (SIGINT); /* nothing to hangup under DOS */
^C
T42 ~ #
Run Code Online (Sandbox Code Playgroud)
我做错了什么或者应该如何使用大小后缀find
?
没有后缀,它使用 512 字节的块 (b)。1k 和 1024c 的单位相同。
但请记住,它正在搜索“已使用的 n 个空间单位”。要存储 1 个字节,您需要一个 1 字节块或一个 1k 块或一个 1M 块...