I have a script that writes to a few files but I need them a specific size. So I'm wondering if there's a way of appending a specific number of null bytes from /dev/zero or however to a file?
| ||||
|
feedback
|
|
You can try this as well
This will read from /dev/zero and append to yourfile NUMBER bytes. | ||||
|
feedback
|
|
truncate is more faster than dd. To grow the file with 10 bytes use:
| |||
feedback
|
|
my first guess would be:
Basically, this command tells dd to "go" at the end of the file and add some bytes previously read from /dev/zero. Regards, | |||
|
feedback
|
or
and to compute the size more easily:
| |||
|
feedback
|
|
If you are padding your file with null bytes, my guess is that you are manipulating the file in a
In this case, the 1st call to
| |||
|
feedback
|