truncate

Shrink or extend the size of a file to the specified size. More information: https://www.gnu.org/software/coreutils/truncate.

truncate --size 10G filename

truncate --size +50M filename

truncate --size -2G filename

truncate --size 0 filename

truncate --no-create --size 0 filename