【发布时间】:2014-12-24 04:38:55
【问题描述】:
我正在使用 grep 来处理带有 grep -orI "id=\"[^\"]\+\"" . | sort | uniq -d 的文件中的模式
输出如下:
./myFile.html:id="matchingR"
./myFile.html:id="other"
./myFile.html:id="cas"
./otherFile.html:id="what"
./otherFile.html:id="wheras"
./otherFile.html:id="other"
./otherFile.html:id="whatever"
什么是一种便捷的管道方式,输出如下:
./myFile.html
id="matchingR"
id="other"
id="cas"
./otherFile.html
id="what"
id="wheras"
id="other"
id="whatever"
基本上按文件名对结果进行分组。
【问题讨论】:
标签: bash command-line awk grep