如何在grep输出(awk,sed)中剪切文件名?

如何在grep输出(awk,sed)中剪切文件名?,sed,awk,grep,Sed,Awk,Grep,你好,我有一个来自grep的输出 cc.log.1:<Operation adaptorMethod="search" adaptorName="Search" status="Success"/> cc.log.12:<Operation adaptorMethod="getOrderId" adaptorName="PersistenceAdaptor" status="Success"/> cc.log.1: cc.log.12: 我需要从一开始就切断文件名,只

你好,我有一个来自grep的输出

cc.log.1:<Operation adaptorMethod="search" adaptorName="Search" status="Success"/>
cc.log.12:<Operation adaptorMethod="getOrderId" adaptorName="PersistenceAdaptor" status="Success"/>
cc.log.1:
cc.log.12:
我需要从一开始就切断文件名,只留下标记

我尝试了几种不同的
awk'/$/'
sed-n'/^$/p'


但是没有成功。有人能帮我吗?

您不需要
sed
awk
cut
您只需要
-h
选项
grep

-h, --no-filename Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search. -h、 --没有文件名 抑制输出时文件名的前缀。这是默认值 只有一个文件(或只有标准输入)要搜索。
如果它来自
grep
并且您有文件名,请发布
grep
命令,因为您可能使用了一个不必要的参数。如果您使用的是awk,则不需要grep或sed。将输入的示例发布到grep,告诉我们您希望从中提取什么,并发布最终的预期输出。