August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

ZCAT Shell bash

How to display the contents of a gzip/gz file By Alvin Alexander. Last updated: Aug 6, 2011 Problem: You have a plain text file that has been compressed with the gzip command, and you’d like to display the file contents with the Unix/Linux cat or more commands.

Solution: Instead of using the cat or more […]

Grep, Awk, and Sed in bash

So, let’s consider the following log file:

www.three.com 10.15.101.11 1353280801 TEST 345 www.one.com 10.14.101.11 1353280801 TEST 343 www.three.com 1.10.11.71 1353280801 TEST 323 www.one.com 10.15.11.61 1353280801 TEST 365 www.two.com 10.10.11.51 1353290801 TEST 55 www.two.com 10.20.13.11 1353290801 REST 435 www.one.com 10.20.14.41 1353290801 REST 65 www.two.com 10.10.11.14 1353290801 REST 345 www.three.com 10.10.11.31 1354280801 REST 34 www.one.com 10.10.13.144 1354280801 […]

if condition-integer expression expected

if condition-integer expression expected

ADV1=94.3 Quantity=96.3 if [ $Quantity -eq $ADV1 ]; then echo “quantity is greter” fi

echo “” | nawk -v ADV1=94.3 -v Quantity=96.3 […]

Parsing – Logs

grep, cat, zgrep and zcat

More on log parsing, I’m taking notes on how to read log files and get the information that I need. On Linux environment, these tools are perfect: grep, cat, zgrep and zcat.

Extracting patterns with grep

We can extract information from a text file using grep. Example, we can extract […]