How to empty a file on a *nix system

To empty a file, e.g. /path/to/foo.txt, do the following

cat /dev/null > /path/to/foo.txt

Tags: