LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-16-2005, 02:39 AM   #1
extremebfn
Member
 
Registered: Jun 2004
Location: bloem
Distribution: asdsa
Posts: 43

Rep: Reputation: 15
Eays way to clear a log file?


Hallo

Does anyone know of a easy way to clear a log file without deleting it?
 
Old 01-16-2005, 03:40 AM   #2
JunctaJuvant
Member
 
Registered: May 2003
Location: Wageningen, the Netherlands
Distribution: OS X & Linux Mint
Posts: 488

Rep: Reputation: 31
Doesn't a search on google suggest a possible solution? First result I found:
Code:
> /path/to/log
This clears the file and keeps permissions intact.
 
Old 01-16-2005, 04:05 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Logrotate is also a very viable solution that I'd venture to guess is probably more of what you want than to clear the file (assuming you are keeping decent tabs on your system )

Cool
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New SQUID user: How to clear the "access.log" and "store.log" automatically? yuzuohong Linux - Networking 2 12-02-2006 05:37 AM
clear or disable file cache acristescu Linux - General 3 11-04-2005 10:25 AM
Help! Clear web.cache and log files on server DogByte Linux - Newbie 1 09-20-2005 06:51 PM
clear file? Red Squirrel Linux - Software 5 07-19-2005 09:27 PM
can not clear log file messages mitch_lin Red Hat 2 04-25-2004 08:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:14 AM.

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