Zeros and ones

Jerry McAllister jerrymc at
Fri May 2 18:56:45 PDT 2003

Hi all,

Thanks for the input.

> > But, I would like to write all ones - as in 0xff or maybe some
> > other pattern - as if there was a /dev/one also.
> > 
> > Is there a nice way to do this using UNIXistic stringing existing
> > stuff together?   Or do I have to write a little piece of code?
> Of course there is a nice way. :-)
> Try something like
> tr '\000' '\377' < /dev/zero | dd of=onesfile bs=512 count=1770000
> to get a file with all bits equal to one.

Wow,  I use tr all the time to clean up files, especially stripping
the extra CR going from MS to UNIX, but it never crossed my dazed
head to use it here.   Thanks for steering me back on the path to all
who responded..

> -- 
> <Insert your favourite quote here.>
> Erik Trulsson
> ertr1013 at

More information about the freebsd-questions mailing list