0

I have used /dev/zero and /dev/random to generate files of certain size. However, is there a way to control variability of generated files?

I would like to create few files that would have same uncompressed size, but different compressed size (compression ratio).

2

1 Answer 1

2

Quick and dirty:

cat /dev/urandom | tr -dc 'abcd' | dd count=10 bs=1 2>/dev/null

generates 10 bytes of (pseudo-)random sequence out of a, b, c, and d. Modify the alphabet (here "abcd") to get other compression rates.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.