I sometimes need to empty the contents of a file without losing active file handles. For instance, to empty log files why my rails development server is running.

This is a neat bash trick to accomplish that (for log/development.log in this example)
cat /dev/null > log/development.log