TRUNCATE(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

✨ 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:


🧚 SEE ALSO 🧚


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