The answer above citing truncate is nice. dd will also do the job:
dd if=test.txt of=test2.txt bs=1 count=8mv test2.txt test.txt
The answer above citing truncate is nice. dd will also do the job:
dd if=test.txt of=test2.txt bs=1 count=8mv test2.txt test.txt