bash clear file and write new contents code example Example: bash command to empty textfile : > file.log