> $ touch myfile.txt
If we're playing golf, this works (overwriting if the file exists):
>myfile.txtIf we're playing golf, this works (overwriting if the file exists):
>myfile.txtThe variant I know that works identically in pretty much every shell I've ever tried is:
:>myfile.txt
And if you don't want to overwrite the file if it exists: :>>myfile.txt