find -execã¯ã1ãã¡ã¤ã«ã«å¯¾ãã¦1åãã¤ã³ãã³ããå®è¡ãxargsã¯æ¨æºå ¥åããåãåã£ãè¤æ°ã®ãã¡ã¤ã«ã«å¯¾ãã¦ãã³ãã³ãã1åã§å®è¡(ã¨ãã£ã¦ãã·ã§ã«ã«æ¸¡ããéçããããããå ¥åãå¤ãããå ´åã¯è¤æ°åã«ããã¦å®è¡)ãã ãããxargsã®ã»ããæ©ãã¨æã£ã¦ãããä¾ãã°ç¹å®ã®ãã¡ã¤ã«ãæ¶ãå ´åã
$ find /tmp/ -type f -mtime +1 -exec rm {} \; # 以ä¸ã¨ã»ã¼åç $ find /tmp/ -type f -mtime +1 -print0 | xargs -0 -n1 rm
ã¨ããããfind -execã§'\;'ã§ã¯ãªãã'+'ãæå®ããã°xargsã¨åãããã«ãè¤æ°ãã¡ã¤ã«ã«å¯¾ãã¦ã³ãã³ãå®è¡ãããããã
ããã¯ãã¹ã¦ã®åä¸ãã¡ã¤ã«ã«å¯¾ãã¦ä¸åã㤠rm ãå¼ãã§ãããããããæè¿ã® find ã§ã¯ xargs ã使ã£ãæ¹æ³ã¨åããã¨ãã§ããã
$ find /tmp/ -type f -mtime +1 -exec rm {} +
æ¸ãã¦ã¦æã£ããã©ããã¡ã¤ã«åé¤ããã ããªã-deleteã§ããã®ã ã£ãã
$ find /tmp/ -type f -mtime +1 -delete