TRUNCATE(1)
β¨ NAME β¨
truncate β shrink or extend the size of a file to the specified size π
So this is the manual page for truncate (that's truncate(1), bestie, the User Commands one) and yes it does exactly what it says on the tin: it changes how big a file is. Make it smaller, make it bigger, whatever. Let's get into it π¦
πΈ SYNOPSIS πΈ
truncate OPTION... FILE...
π DESCRIPTION π
Shrink or extend the size of each FILE to the specified size. That's the whole vibe.
A FILE argument that does not exist is created β¨ (unless you tell it not to be, see below).
If a FILE is larger than the specified size, the extra data is lost. Gone. Poof. π No undo, no take-backs.
If a FILE is shorter, it is extended and the sparse extended part (hole) reads as zero bytes. So it's giving "I'm bigger now" but really it's just a hole full of nothing that reads as zeros π³οΈ
Mandatory arguments to long options are mandatory for short options too. Like, if an option needs a value, the short version needs it too. No exceptions, periodt.
π OPTIONS π
-c,--no-createβ do not create any files. If it's not there, we're not making it, no cap π-o,--io-blocksβ treat SIZE as number of IO blocks instead of bytes. Block math hours π₯-r,--reference=RFILEβ base size on RFILE. Copy her size, she's the blueprint π-s,--size=SIZEβ set or adjust the file size by SIZE bytes--helpβ display this help and exit--versionβ output version information and exit
π SIZING, iykyk π
The SIZE argument is an integer and 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. Slay, both systems are in the building π«Ά
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
Lowkey be careful with these. Shrinking a file drops the extra data for real β it is not recoverable, bestie. The<and>ones are the cautious main character options.
π AUTHOR π
Written by Padraig Brady. Iconic, honestly π
π REPORTING BUGS π
Found a bug? Not me finding a bug π Tell the people:
- Report bugs to:
bug-coreutils@gnu.org - GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
- Report any translation bugs to <https://translationproject.org/team/>
π§ SEE ALSO π§
dd(1),truncate(2),ftruncate(2)- Full documentation <https://www.gnu.org/software/coreutils/truncate> or available locally via:
info '(coreutils) truncate invocation'
Packaged by Ubuntu (9.10-1ubuntu2) π
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. (Fr fr, read that one twice π)
And that's the page, bestie! π Coming at you from GNU coreutils 9.10, dated August 2026, filed under TRUNCATE(1) in the User Commands section. Go forth and resize responsibly β¨π¦
π¦ where this page comes from
- ubuntu stonking: gnu-coreutils 9.10-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms