Command Line

There are several ways to empty files using the command line on a linux file.

Using the Echo Command

echo “” > filename.log

Using the cat command

cat > filename.log

You might need to press Ctrl+C on this.

cat command with /dev/null

cat /dev/null > filename.log

You can cat /dev/null into the file