empty contents of file linux truncate command code example Example: bash command to empty textfile : > file.log