OS Manuals

/usr/bin/truncate

Cross-platform Rust rewrite of the GNU coreutils.

From uutils 0.12.0-r6 (os), captured 2026-11-07 by running truncate --help (exit 0). permalink

Shrink or extend the size of each file to the specified size.

Usage: truncate [OPTION]... [FILE]...

Arguments:
  <FILE>...

Options:
  -o, --io-blocks          treat SIZE as the number of I/O blocks of the file rather than bytes
  -c, --no-create          do not create files that do not exist
  -r, --reference <RFILE>  base the size of each file on the size of RFILE
  -s, --size <SIZE>        set or adjust the size of each file according to SIZE, which is in bytes
                           unless --io-blocks is specified
  -h, --help               Print help
  -V, --version            Print version

SIZE is an integer with an optional prefix and optional unit.
The available units (K, M, G, T, P, E, Z, and Y) use the following format:
    'KB' => 1000 (kilobytes)
    'K' => 1024 (kibibytes)
    'MB' => 1000*1000 (megabytes)
    'M' => 1024*1024 (mebibytes)
    'GB' => 1000*1000*1000 (gigabytes)
    'G' => 1024*1024*1024 (gibibytes)
SIZE may also be prefixed by one of the following to adjust the size of each
file based on its current size:
    '+' => extend by
    '-' => reduce by
    '<' => at most
    '>' => at least
    '/' => round down to multiple of
    '%' => round up to multiple of
Options (6)
OptionDescriptionSource
-o, --io-blockstreat SIZE as the number of I/O blocks of the file rather than byteshelp + man
-c, --no-createdo not create files that do not existhelp + man
-r, --reference RFILEbase the size of each file on the size of RFILEhelp + man
-s, --size SIZEset or adjust the size of each file according to SIZE, which is in bytes unless --io-blocks is specifiedhelp + man
-h, --helpPrint helphelp + man
-V, --versionPrint versionhelp + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.