dacaprice.com from fitness to technology.

4Sep/090

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 (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.