你好我有grep的输出
cc.log.1:<Operation adaptorMethod="search" adaptorName="Search" status="Success"/>
cc.log.12:<Operation adaptorMethod="getOrderId" adaptorName="PersistenceAdaptor" status="Success"/>
我需要从开头剪切文件名,只留下标签
我尝试了awk '/<Operation/,/>$/'
sed -n '/^<Ope/,/>$/p'
等的几种变体
但没有成功。有谁可以帮助我?
答案 0 :(得分:2)
您不需要sed
,awk
或cut
只需要-h
的{{1}}选项:
-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.