Handling log files in UNIX

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2006
Posts: 2
Reputation: titotoms is an unknown quantity at this point 
Solved Threads: 0
titotoms titotoms is offline Offline
Newbie Poster

Handling log files in UNIX

 
0
  #1
Jan 16th, 2007
Hi,

What is a log file?What is its purpose?How do I open, read and write to log files?

Thanks,
Toms
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 523
Reputation: pty is on a distinguished road 
Solved Threads: 37
pty's Avatar
pty pty is offline Offline
Posting Pro

Re: Handling log files in UNIX

 
0
  #2
Jan 16th, 2007
A log file is a record of what has happened. On linux/unix they tend to be in /var/log.

As a developer I use them when stuff goes wrong and I want to find out why.

IT use them to keep tabs on things, monitor network use etc.

Web masters use them to spot trends and stuff (often using something to interpret their log files like webalizer).

You write to a log file like any other text file. To read from one just type cat filename.log or tail filename.log.

A useful way of printing the end of a log file and update it when it changes is to use tail -f filename.log.
Note to self... pocket cup
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC