LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2008, 02:18 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Rep: Reputation: 15
How to print in the console ?


i want to print lines from a file ABC.log in the console.

RULE
lines which starts with words "2008-05-21" and ends with words "2008-05-21"


I want to print all lines in between .

How ?

whats the command ?

can grep help me ?
 
Old 05-27-2008, 03:15 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

grep is indeed the weapon of choice.
Code:
grep '2008-05-21.*2008-05-21' ABC.log
should do it.

Edit:
I should really read posts before answering them...
This should work:
Code:
awk '/^2008-05-2/,/2008-05-2$/' ABC.log
Dave

Last edited by ilikejam; 05-27-2008 at 03:21 AM. Reason: Read the question
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enable console_print() to print to console? pat_and_cami Programming 1 04-17-2006 11:17 PM
print text file to the console window, how? l.u Linux - Software 3 06-14-2005 02:54 PM
my linux console don't print color in c file ngan_yine Programming 6 10-18-2004 03:31 AM
print a man page in console?? mipia Slackware 2 08-25-2003 12:35 PM
Snort to log ALL packets, and print them to the console?!? bripage Linux - Security 5 10-01-2002 08:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration