LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-26-2006, 01:34 AM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 49
cat file but don't quit


I am having a problem. I want to read a file, just like when using cat, but I want to keep waiting for a new line instead of quitting when it reaches the end of the file. Or if anyone has any better idea of how to print out all the content of a logfile to stdout as the new entries in the logfile appear.

Hope I made myself clear enough.
 
Old 08-26-2006, 01:46 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
Have a look at man tail - it should do what you want. For example, the following will open a log file and leave the output waiting for new lines from the log:
Code:
tail -f /var/log/messages
 
Old 08-26-2006, 01:56 AM   #3
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 49
Thanks! :D
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
filesize limit on 'cat $file | sed > $file' drkstr Linux - Software 2 07-10-2006 03:47 AM
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 09:10 AM
Printing a new file over the old file using cat mrobertson Programming 4 07-07-2005 11:18 AM
output to a file - cat? grep? Godsmacker777 Linux - Newbie 6 12-08-2004 11:06 AM
Cat with Binary File? Xaque208 Linux - General 1 12-06-2004 08:59 PM


All times are GMT -5. The time now is 11:46 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration