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

1 - About

The awk command is a filter that combines the functions of:

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

3 - Management

3.1 - Function

4 - Example

4.1 - ls

Linux - ls (List directory content) with only acl information.


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


-rw-rw---- 1 oracle oinstall

4.2 - To get the cached memory

With the free command:


[[email protected] ~]$ free | grep Mem | awk '{print $7}'


137329856


[[email protected] ~]$ free


total       used       free     shared    buffers     cached
Mem:    1058964444 1011201796   47762648          0    1272644  137329872
-/+ buffers/cache:  872599280  186365164
Swap:    101023736       4392  101019344

4.3 - Escape

Example on how to escape the :


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

5 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap