TRUNCATE(1)
๐ธ NAME ๐ธ
truncate โ shrink or extend the size of a file to the specified size, bestie ๐
โจ SYNOPSIS โจ
truncate OPTION... FILE...
๐ DESCRIPTION ๐
Okay so here's the tea โ: truncate shrinks or extends the size of each FILE to the size you told it. That's it. That's the whole job. Iconic, honestly.
A FILE argument that does not exist? Yeah, it gets created. New file, who dis ๐
If a FILE is larger than the size you specified, the extra data is lost โ like, gone gone, no takebacks ๐ญ. If a FILE is shorter, it gets extended, and the sparse extended part (the hole ๐ณ๏ธ) reads as zero bytes. Free real estate, but make it zeroes.
Mandatory arguments to long options are mandatory for short options too. Yes bestie, if it's required long, it's required short. No shortcuts on the shortcuts ๐
-c,--no-createโ do not create any files. Chill. Just don't make anything new โ-o,--io-blocksโ treat SIZE as a number of IO blocks instead of bytes. Different unit, same drama ๐ง-r,--reference=RFILEโ base the size on RFILE. Copy her measurements, periodt ๐-s,--size=SIZEโ set or adjust the file size by SIZE bytes. The main character option fr fr ๐--helpโ display this help and exit. Your little cheat sheet ๐ซถ--versionโ output version information and exit. Receipts, always ๐งพ
๐ฆ THE SIZE ARGUMENT ๐ฆ
The SIZE argument is an integer plus an optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on. It's giving very thorough, and we love that for her ๐
SIZE may also be prefixed by one of the following modifying characters:
'+'โ extend by'-'โ reduce by'<'โ at most'>'โ at least'/'โ round down to multiple of'%'โ round up to multiple of
๐ AUTHOR ๐
Written by Padraig Brady. King behaviour, no cap ๐
๐ REPORTING BUGS ๐
Found a bug? Tell the girlies:
- Report bugs to: <bug-coreutils@gnu.org>.
- Report any translation bugs to: <https://translationproject.org/team/>.
- GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
โญ COPYRIGHT โญ
Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (Read that again bestie โ no warranty, fr fr ๐)
๐ธ SEE ALSO ๐ธ
Full documentation <https://www.gnu.org/software/coreutils/truncate> or available locally via: info '(coreutils) truncate invocation' โ iykyk ๐
GNU coreutils 9.12, dated September 2026 โ that's the whole TRUNCATE(1) vibe check, bestie. Go resize something responsibly, mwah ๐โจ๐ฆ
๐ฆ where this page comes from
- arch rolling: coreutils 9.12-2 ยท GPL-3.0-or-later AND GFDL-1.3-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms