Showing posts from October, 2015

List Of $1 Hosting Websites - 2015

List Of $1 Hosting Websites ttp://

How to split a huge size log file and only get what you want in Linux?

Today I encounter a task as follow:

I need to extract a 7.3GB Apache access log and ONLY grab the access log starting from 30 August and up to today.

I don't need to say it is non-sense to open a 7.3 GB file in a text editor, even in vi under linux, the RAM that is used is huge, and it just doesn't work that way.

So to solve this problem, here are the steps I took, thanks to the following reference:

Find out the exact string first occurrence in the log file and print the first 5 lines.  Actually I can only print one line but I just like 5:grep -n "30/Aug/2015" access_log | head -n 5The returned line will be:61445828: - - [30/Aug/2015:00:00:01 +0800] "GET <somewebsite>/index.htm HTTP/1.1" 200 10824The first item: 61445828 is the line numberCount the total number of lines in access log, and get the number:wc -l access_logThe return is: 64328208 access_log.oldNow,…