Clear the contents of an existing UNIX file

A really simple but useful tip. To clear the contents of an existing file you can override the file with another empty file.

sudo cp /dev/null my_file.txt