[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do I pad files in Linux?



Stan Hoeppner <stan@hardwarefreak.com> writes:

> One possibility might be
> 
> ~$ cat file1 file2 >> file3
> 
> where file1 is your binary and file2 contains 64 nulls.  Now you simply
> need to create a file containing exactly 64 nulls.  I've never screwed
> with this, but I'd guess it can be done with one of the scripting
> languages, maybe a text manipulator such as awk or its variants, etc.
> Loop a print command with the proper special character syntax for null
> 64 times piping the output to file2.  You may even be able to create it
> in vi.

dd if=/dev/zero bs=1 count=64 >> file

urs


Reply to: