Possible Duplicate:
Why does Mac's $find not have the option -printf?發現:-printf:未知的選項
不知道什麼是錯用下面的命令,但任何人都可以當場錯誤:
find public_html -name '*.php' -printf '%h \n' | sort -u > dirlist.txt
基本上,我attemtping找出在我的public_html所有具有* .php擴展名的目錄的目錄名稱。然後打印出找到該文件的目錄。這樣做的輸出管道進行排序,重複的條目由-u標誌去掉,並將結果保存在新的文件dirlist.txt
但是我得到執行時是:
find: -printf: unknown option
不知道在那裏我得到這個錯誤
感謝
這個錯誤是因爲'find'不*有*一個'printf'選項 - 完全錯誤信息說什麼。檢查你係統上的'man printf'找出該做什麼。 – 2012-03-20 17:03:45
Linux,OS X,BSD? – Adam 2012-03-20 17:04:21
嗨,亞當,它的OS X獅子,使用mac終端 – user1020069 2012-03-20 17:06:44