Why use :> instead of > ?
During a IRC conversation somebody mentioned that using :> was a better way than using >. So to make a file named testfile empty you would use
:> testfileThe explaination is that :> is more portable. Some shells (such as zsh) auto-instantiate a cat in the current shell and listen for stdin when given a redirect with no command. Rather than cat /dev/null, : is much simpler. Often this behavior is different in interactive shells rather than scripts, but if you write the script in a way that also works interactive, debuging by copy-paste is much easier.