Bash: truncate a file to zero length

Very easy way to do this:

$ > file

and you’re done.

If you need finer control use the ‘truncate’ coreutil.

Leave a Reply

Your email address will not be published. Required fields are marked *