在 zsh 下使用以下 find 命令查找指定目錄下所有頭文件時
find . -name *.h
或
find / -name ls*>temp &
出現問題:
no matches found: *.h或no matches found: ls*
后來查看了一些資料才知道,這是由於zsh導致的。
具體原因:
因為zsh缺省情況下始終自己解釋這個 *.h或ls*,而不會傳遞給 find 來解釋。
解決辦法:
vim ~/.zshrc
添加以下字段,
setopt no_nomatch
然后生效
source ~/.zshrc