abc abc - 1 month ago 7
Linux Question

How do I get an equivalent of /dev/one in Linux

You can use

dd if=/dev/zero of=file count=1024 bs=1024


to zero fill a file.

Instead of that I want to one fill a file. How do I do that?

There is no /dev/one file, so how can I simulate that effect via on bash shell?

Answer

Try this:

dd if=<(yes $'\01' | tr -d "\n") of=file count=1024 bs=1024

Substitute $'\377' or $'\xFF' if you want all the bits to be ones.

Comments