truncate wasn’t on my list when it began five years ago, or even in later additions. I can see why: It’s a rather arbitrary and vicious tool, snapping off files at predetermined lengths and leaving the remainder to flutter away in the wind.
I can’t think of any exact use for
truncate aside from determining an exact, to-the-byte length of a file, perhaps for some sort of network testing or disk performance check. And considering the leftovers are summarily discarded, it’s a lethal decision to use it.
truncate follows the same flags for size and units as split and some other toys from coreutils. If you’re familiar with much of what’s in the suite, it will only take you a second to get used to
And that’s about all I can think of to say about
truncate. Use wisely. 😉