Clean up a file
echo -n > logfile
- the -nflag instructsechocommand not to append a new line.
cat /dev/null > logfile
- the :character is a null command.
: > logfile
sudo sh -c ': > logfile'
: | tee logfile
: | sudo tee logfile
> logfile
sudo sh -c '> logfile'
truncate -s 0 logfile