Zeros and ones

Andy Farkas andyf at speednet.com.au
Fri May 2 16:58:18 PDT 2003


On Fri, 2 May 2003, Jerry McAllister wrote:

> It is easy and convenient to use /dev/zero to write out a number of
> zero bytes to somewhere - as in:
>
>           dd if=/dev/zero of=zerofile bs=512 count=1770000
>                 or
>           dd if=/dev/zero of=/dev/da1 bs=512 count=1770000
>
> 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?
>
> Thanks for any [positive] suggestions.
>
> ////jerry

Play around with jot(1).

--

 :{ andyf at speednet.com.au

        Andy Farkas
    System Administrator
   Speednet Communications
 http://www.speednet.com.au/





More information about the freebsd-questions mailing list