Pages

Saturday, May 30, 2009

How to empty a file without deleting and recreating it?

Was working with log files and wanted a quick way to empty them and recreate them. rm and touch would do it, but found something simpler:

cat /dev/null > filename



No comments: