dacaprice.com from fitness to technology. mostly technology. sometimes fitness.

4Sep/092

How to zero out a file in Linux

Ever need to quickly clear a file out in Linux?  Maybe a log file that is growing out of control?  Rather than delete it, try this:

[dacaprice@fedora10 ~]$ > /var/log/messages

Now your messages file is empty, and the file retains its permissions.

Tagged as: Leave a comment
Comments (2) Trackbacks (0)
  1. PERFECT!!! Thanks!

  2. Thanks a lot!!!


Leave a comment

(required)

No trackbacks yet.