The below command should do the trick.
dd if=/dev/zero count=1 bs=30M of=/tmp/file_with_specified_size
Hi @Trevor ,
As I do not see the usual note "RHCE-level and below is the intended audience for this query!", can I share my answer ? Or a hint ?
Regards,
Tshimanga
TM, because of your courtesy and consideration,
I will gladly open the door for you to provide an
answer, or a hint!!!
The below command should do the trick.
dd if=/dev/zero count=1 bs=30M of=/tmp/file_with_specified_size
Love the response TM!!!
Now, for that not-so-seasoned Linux person, I'd like to
pose a couple of separate questions, based on your
answer:
Question1: For the output file (of=/tmp/....), you were
specific with the directory (/tmp) that the file would be
created, but generic with the name of the file (file_with...).
My question is, does the file HAVE TO BE created in the
/tmp directory?
Question2: Your use of count=1 and bs=30M, is certainly
acceptable. My question is, do I lose (or gain) anything if
I use either of the following combos of count and bs, instead
of the values that you used in your answer:
- count=10 bs=3M
- count=30 bs=1M
Thanks again TM!!!!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.