TRUNCATE(1)
π TRUNCATE(1) β the manual page, but make it cute
okay bestie, welcome to TRUNCATE(1), a General Commands Manual entry, and honestly? she's that girl. this is your one-stop shop for making files bigger or smaller whenever you want. no drama, just math. πΈ
β¨ NAME β¨
truncate β Shrink or extend the size of each file to the specified size.
π SYNOPSIS π
truncate [OPTION]... [FILE]...
π DESCRIPTION π
Shrink or extend the size of each file to the specified size. that's it. that's the whole vibe. you point her at some files, you hand her a size, and she makes it happen β cutting them down or growing them out, no questions asked. π
π OPTIONS π
-o,--io-blocksβ treatSIZEas the number of I/O blocks of the file rather than bytes (so like, block math instead of byte math, iykyk)-c,--no-createβ do not create files that do not exist (she'll just skip 'em, respectfully π)-r,--reference <RFILE>β base the size of each file on the size ofRFILE(copy her measurements, basically β¨)-s,--size <SIZE>β set or adjust the size of each file according toSIZE, which is in bytes unless--io-blocksis specified-h,--helpβ Print help-V,--versionβ Print version<FILE>β the file(s). your main characters. π
π₯ EXTRA π₯
so SIZE? she's an integer with an optional prefix and an optional unit. iconic range, honestly.
the available units are K, M, G, T, P, E, Z, and Y, and they go like this:
'KB' => 1000 (kilobytes)
'K' => 1024 (kibibytes)
'MB' => 1000*1000 (megabytes)
'M' => 1024*1024 (mebibytes)
'GB' => 1000*1000*1000 (gigabytes)
'G' => 1024*1024*1024 (gibibytes)
note: lowercase-prettyKis the 1024 one, andKBis the 1000 one. do not mix them up bestie, we've all been there. π
SIZE may also be prefixed by one of the following, which adjusts 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
like, she's not just setting a number, she's negotiating with the number that's already there. queen behavior. π
β VERSION β
v(uutils coreutils) 0.12.0
π¦ EXAMPLES π¦
Set a size of 10 GB to an existing file, or create a new file with the specified size:
truncate [-s|--size] 10G path/to/file
Extend the file size by 50 MiB, fill with holes (which reads as zero bytes):
truncate [-s|--size] +50M path/to/file
Shrink the file by 2 GiB, by removing data from the end of file:
truncate [-s|--size] -2G path/to/file
Empty the file's content:
truncate [-s|--size] 0 path/to/file
Empty the file's content, but do not create the file if it does not exist:
truncate [-s|--size] 0 [-c|--no-create] path/to/file
The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.
okay that's the whole page, you're officially a truncate girlie now π«Ά go forth and resize. this was the TRUNCATE(1) manual, dated 2026-09-25, brought to you by v(uutils coreutils) 0.12.0 β mwah, love u, bye bestie!! ππβ¨
π¦ where this page comes from
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms