gpt4 book ai didi

search - grep 列出没有内容的文件名

转载 作者:行者123 更新时间:2023-12-04 00:24:09 25 4
gpt4 key购买 nike

我们如何在使用 grep 搜索后只列出文件名?

当我使用

grep -i -R "search keyword" folder

它还会列出所有内联代码行。

最佳答案

来自 grep man 页面:

-L, --files-without-match Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match.

-l, --files-with-matches Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. (-l is specified by POSIX.)

对您来说,-l 选项会有所帮助。

关于search - grep 列出没有内容的文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31065284/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com