truncate Command Examples

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

truncate --size 10G {{path/to/file}}

truncate --size +50M {{path/to/file}}

truncate --size -2G {{path/to/file}}

truncate --size 0 {{path/to/file}}

truncate --no-create --size 0 {{path/to/file}}