How to make a file empty on linux
1 minute read Modified:
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 :> testfile
The 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.