Unix - How do erase the contents of a file but keep the file intact

http://superuser.com/questions/218214/how-do-erase-the-contents-of-a-error-log-file-but-keep-the-file-intact

truncate -s0 file_name