微信搜索“毛凌志岗前心得”小程序
[shell] AWK筆記 | Toknow Blog
[shell] AWK筆記
[shell] AWK筆記Posted on 2011/12/31 by angus 計算web log IP次數?1awk '{++ip[$1]}END{for(key in ip) print key,ip[key]}' accesslog忽略空字串資料?1awk '{if($2 !~ /^[ ]*$/) print "second field isnot empty" }}'印出某欄位後所有資料?1awk '{for(i=2;i<=NF;i++){printf "%s ", $i}; printf "\n"}'
計算web log IP次數
awk
'{++ip[$1]}END{for(key in ip) print key,ip[key]}'
accesslog
忽略空字串資料
'{if($2 !~ /^[ ]*$/) print "second field isnot empty" }}'
印出某欄位後所有資料
'{for(i=2;i<=NF;i++){printf "%s ", $i}; printf "\n"}'
Copyright @ 2024 lexus Powered by .NET 8.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster