gpt4 book ai didi

printing - 多个文件中的 Grep 打印与文件名匹配的行

转载 作者:行者123 更新时间:2023-12-01 22:18:54 25 4
gpt4 key购买 nike

我正在使用 grep 从一个文件中的两个不同文件中找到匹配的行。它从 File1File2File3 中找到匹配的文件就好了,但是从有多个文件的那一刻起,它就打印文件在行旁边找到它的名称。

grep -w -f File1 File2 File3

输出:

文件 2:模式

文件 2:模式

文件 3:模式

是否有避免打印 File2:File3: 的选项?

最佳答案

grep --no-filename -w -f File1 File2 File3

关于printing - 多个文件中的 Grep 打印与文件名匹配的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17199577/

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