July 4, 2013 by snowcrash 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.