Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下查找命令..有没有办法将查找限制为仅 *.py 文件?
find . | xargs grep 'GIT' -sl
谢谢,
您已经在使用find,所以很简单。这是一种方法:
find
find . -name '*.py' -print | xargs grep 'GIT' -sl {}
是的。大多数版本find将识别您在-name选项中提供的任何通配符:
-name
find . -name \*.py | xargs grep 'GIT' -sl
资源
是的,您可以只使用星号字符 (*):
find . -name' *.py'