How to just:
Categories: Technical | design | Other | Food | All

How to just zero out a file without removing it

Description:

How to remove the contents of a file on linux/bsd without actually removing it. This is useful if you want to nuke something like a log file, but don't want to lose the permissions.


It's really easy. Say your file is called "foo.log" just do this:
 $ >foo.log
use the "greater than" symbol, followed by the file name. It will erase the contents of the file, but will do it "in place". Enjoy :).

Link to this



Be sure to check out our other project, Thingist - Things you love Looking for other Technical articles?
Here is another random article from this category:

How to get into the menu on an Intermec 2435 handheld

The menu on the intermec 2435 handheld is where you change the wifi and terminal settings. This shows you how to get into the menu on the intermec 2435.

Read More
Be sure to check out our other project, Thingist - Things you love