[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: how to i return a filesize to "0"....?
- From: Paul Wilkins <pmw57 xtra co nz>
- To: redhat-install-list redhat com
- Subject: Re: how to i return a filesize to "0"....?
- Date: Tue, 03 Aug 1999 14:49:38 +1200
Chris Albertson wrote:
> Matt Lemsing wrote:
> > how do i return a filesize to 0? That is, i want to cleanup my HUGE
> > log files from taking up room, but rather than getting rid fo the
> > files i want to be able to clear all their contents out and returm
> > their size value to 0 - is this possible and if so how do i do it..?
>
> Use any text editor and simply delete all the lines. "vi" will do it
> just fine.
Nope, a lotta work that.
> You can also delete the file with "rm" and recreate an empty file by
> using the "touch" command.
*** Warning - rant ahead ***
No No NO NO NO!!
Think first about the file permissions. What happens to them?
Those file permissions get destroyed and go to the wind, leaving only
your default permissions for the file.
Bad boy, go directly to jail, do not pass go, do not collect $200, etc
The easiest way to clear a file while retaining file permissions is to
direct the null device to the file.
cat /dev/null > /var/log/messages (or whatever file it may be)
Paul Wilkins
--
Proudly sent with Linux
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]