- 論壇徽章:
- 12
|
本帖最后由 phanx 于 2015-05-17 10:51 編輯
回復(fù) 1# orablue
因?yàn)楫?dāng) find 沒有找到任何文件的時候,傳給xargs du -ck 就是一個空行,相當(dāng)于直接執(zhí)行 du -ck 命令。
也就是說在cd /data/log/4001/dblogs/relay/ 后, 相當(dāng)于在 /data/log/4001/dblogs/relay 這個目錄下執(zhí)行 du -ck 命令。
du的對象也就是目錄本身了。
正確的寫法是 cd /data/log/4001/dblogs/relay/; find ./ -type f -cmin -15 |xargs -r -n1 du -ck
man xargs
-r If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there
is no input. This option is a GNU extension. |
|