<分区>
Possible Duplicate:
Why does Mac's $find not have the option -printf?
不确定以下命令有什么问题,但任何人都可以发现错误:
find public_html -name '*.php' -printf '%h \n' | sort -u > dirlist.txt
基本上,我试图在我的 public_html 目录中找出所有扩展名为 *.php 的目录的名称。然后打印出找到该文件的目录。其输出通过管道进行排序,重复条目由 -u 标志删除,结果存储在新文件 dirlist.txt
但是我在执行时得到的是:
find: -printf: unknown option
不知道哪里错了
谢谢