Shell Data Processing - Awk (grep and sed) - Output filtering

Card Puncher Data Processing

Shell Data Processing - Awk (grep and sed) - Output filtering

About

The awk command is a filter that implements a language that is dedicated to text processing and combines the functions of:

AWK is a (tool|language) for event-based data processing.

Management

Function

http://www.math.utah.edu/docs/info/gawk_13.html

Example

ls

Ls with only acl information.

ls -l | grep pls.txt |  awk '{print $1, $2, $3, $4}'
-rw-rw---- 1 oracle oinstall

To get the cached memory

With the free command:

[oracle@Exalytics-01 ~]$ free | grep Mem | awk '{print $7}'
137329856

[oracle@Exalytics-01 ~]$ free
total       used       free     shared    buffers     cached
Mem:    1058964444 1011201796   47762648          0    1272644  137329872
-/+ buffers/cache:  872599280  186365164
Swap:    101023736       4392  101019344

Escape

Example on how to escape the :

awk '{print $1"\:"$2}'

Documentation / Reference





Discover More
Io Input Stream
I/O - Stream

A stream concept at the io level is a file (generally a text file) A stream is an abstract concept for files and io devices which can be read or written, or sometimes both. I/O devices can be interpreted...



Share this page:
Follow us:
Task Runner