TRUNCATE(1) | General Commands Manual | TRUNCATE(1) |
truncate
— change
the size of files
truncate |
[-c ] -r
ref_file file... |
truncate |
[-c ] -s
[+|-|%|/]size[suffix]
file... |
truncate
changes the size of each given
file. Either with a size operation given via the
-s
option or via a reference file given by
-r
ref_file.
-c
-r
ref_file-s
[+|-|%|/]size[suffix]size is an integer optionally followed by a suffix being one of KMGTP (Kilo, Mega, Giga, Tera, ...) using power of 1024 by default, which can be either explicit via adding iB (like MiB), or turned into powers of 1000 by adding B (like MB).
The truncate
utility exits 0 on
success, and >0 if an error occurs.
A truncate
utility appeared in FreeBSD
4.2.
Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
October 12, 2024 | Linux |