awk '{gsub(/"/,"",$6); type[$6]++; size[$6]+=$10} END {for(t in type) print t,type[t],size[t]}' access.log 掌握这些sed和awk的高级用法后,你会发现大多数文本处理任务都能在几行命令内解决,无需动用Python等重型工具。
awk、grep、sed是linux操作文本的三大利器,合称文本三剑客,也是必须掌握的linux命令之一。三者的功能都是处理文本,但侧重点各不相同,其中属awk功能最强大,但也最复杂。grep更适合单纯的查找或匹配文本,sed更适合编辑匹配到的文本,awk更适合格式化文本 ...
The awk command can make it easy to remove duplicate characters from a string even when those characters aren’t sequential, especially when the process is turned into a script. First, the awk command ...
The awk programming language often gets overlooked for Perl, which is a more capable language. Out in the real world, however awk is found even more ubiquitously than Perl. It also has a smaller ...
一些您可能无法访问的结果已被隐去。
显示无法访问的结果