I extensively use awk (along with cut and grep) for data processing of log files or for any text processing needs.私Awkの広範囲に使用する(と一緒にカットアンドgrep )のデータ処理のログファイル、または任意のテキスト処理が必要です。 AWK is an excellent text processing tool / filter and report generator. Awkのは、優れたテキスト処理ツール/フィルタおよびレポート生成します。

Why is AWK so important? Awkのはなぜです非常に重要なものですか?
It is an excellent filter and report writer.これは優れたフィルタおよび報告書の作家です。 Many UNIX utilities generates rows and columns of information.行と列の多くのUnixユーティリティの情報を生成します。 AWK is an excellent tool for processing these rows and columns, and is easier to use AWK than most conventional programming languages. Awkのは、優れたツールですこれらの行と列の処理、およびAwkのは、より簡単に使用できるほとんどの従来のプログラミング言語です。 It can be considered to be a pseudo-C interpretor, as it understands the same arithmatic operators as C. AWK also has string manipulation functions, so it can search for particular strings and modify the output.ことができますとして考慮されることは、擬似c interpretor 、同じことを理解してarithmatic c. Awkの演算子としても文字列操作関数は、特定の文字列を検索できるように変更したとすると出力されます。 AWK also has associative arrays, which are incredible useful, and is a feature most computing languages lack. Awkの連想配列にも、これは信じられないほど便利ですが、ほとんどのコンピューティングの言語とは、機能不足です。 Associative arrays can make a complex problem a trivial exercise.連想配列は、複雑な問題に卑近な運動です。


While looking for an obscure awk command I came across this nice無名のAwkのコマンドを探している間に来た全体このニース awk resource Awkのリソース .です。 Highly recommended.強くお勧めします。

For example I just used awk to find out how much data I was serving to image leechers (websites which directly link to your images) from my sites.たとえばただAwkのことを確認するに使用されるデータを私はどれくらいの配信をイメージleechers (ウェブサイトに直接リンクしている画像)より私のサイトです。 I used the simple script below to get the data (in bytes) from my log files.私の下使用して簡単なスクリプトを取得するにデータ(バイト)より私のログファイルです。

egrep 'gif|jpg|png' /var/log/httpd/access_log*|grep -v taragana|cut -f10 -d' '|awk '{if($0 != "-") sum = sum + $0} END {print sum}' egrepの' gif | jpg | PNG形式の'の/ var / log /のhttpd /はaccess_log * | grep - vのTaragana |カット- F10キー- d 'で' | Awkの' (もし( $ 0 ! = " -" )の合計=合計+ $ 0 )エンド(印刷の合計) '