除去所有的c和h文件
grep "Language" * -nR --exclude={*.c,*.h}从所有的c和h和p文件中搜索grep "ccc" *.[chp] -nR grep 'hello' ./ -nR --include="*.sh" --include="*.c"除去具体的文件
grep "Language" * -nR --exclude-from=customer.conf从搜索到的文件中搜索
find ./* -name "customer.conf" |xargs grep "tri"find ./* -name "*.c" |xargs grep "tri"查找多类型
1.无法查找cpp
find ./* -name "*.[h|c|o]"2.
find ./* -regex ".*\.\(pro\|o\|h\)"3.
find ./* -name "*.o" -o -name "*.c" -o -name "*.cpp"
本文介绍了如何使用grep命令从特定类型的文件中搜索指定的内容,并展示了排除特定文件或文件夹的方法。此外,还提供了几种find命令的用例来定位不同类型的文件。
1412

被折叠的 条评论
为什么被折叠?



