Awk Tutorial

1.0 awk

awk is a filter which takes the input and gives output after matching desired patterns and doing processing linked to matched patterns. awk is well suited for processing voluminous raw text data and producing statistical reports from it.

awk is named after the first character of the names of its designers, Al Aho, Peter Weinberger and Brian Kernighan, who developed it for Unix systems in the 1970s.… Read more

grep Command in Linux

1.0 grep

grep is a program for searching a given string pattern in files. It searches the files for the pattern and prints the lines that contain strings matching the pattern. For example,

$ # grep pattern filenames ... 
$ grep 'hbox' find.c
    GtkWidget *window, *scrolled_win, *hbox, *vbox, *find;
    hbox = gtk_hbox_new (FALSE, 5);
    gtk_box_pack_start (GTK_BOX (hbox), w -entry, TRUE, TRUE, 0);
    gtk_box_pack_start (GTK_BOX (hbox), find, FALSE, TRUE, 0);
    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);

2.0 grep Command Syntax

grep [OPTIONS] pattern [file ...]
grep [OPTIONS] [-e pattern | -f file ] [file ...]

3.0 Regular Expressions

The pattern, mentioned above, is a regular expression.… Read more