xxxxxxxxxx
# In bash, just
> filename
# will do. This will leave you with an empty file filename.
# PS: If you need sudo call, please consider to use truncate as answered here.
# https://superuser.com/questions/90008/how-to-clear-the-contents-of-a-file-from-the-command-line/634217#634217