-s, --size
Set or adjust the file size by SIZE bytes.
An option of truncatex.
Usage
truncatex -s SIZE OPTION... FILE...
truncatex --size=SIZE OPTION... FILE...Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
-s | --size | SIZE | set or adjust the file size by SIZE bytes |
Examples
Empty a log file without deleting it
truncatex -s 0 app.logCreate a 100 MiB (sparse) file
truncatex -s 100M disk.imgCreate a file of exactly one million bytes
truncatex -s 1MB data.binGrow a file by 1 KiB of zero bytes
truncatex -s +1K data.binRemove the last 10 bytes of a file
truncatex -s -10 data.binCap a file at 1 MiB, leaving smaller files alone
truncatex -s '<1M' cache.dbMake sure a file is at least 4 KiB
truncatex -s '>4K' header.binRound a file's size up to a multiple of 512 bytes
truncatex -s %512 image.rawRound a file's size down to a multiple of 4 KiB
truncatex -s /4K image.rawMake a file 100 bytes larger than another
truncatex -r original.bin -s +100 copy.binEmpty every log that exists, without creating missing ones
truncatex -c -s 0 a.log b.log c.logSize a file in I/O blocks rather than bytes
truncatex -o -s 8 blocks.binCheck the result with wcx
truncatex -s 2K f && wcx -c fHelp in the terminal
gnux help truncatex --size