Computing.Net > Forums > Unix > to create a file of specified size

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

to create a file of specified size

Reply to Message Icon

Original Message
Name: u123
Date: September 29, 2004 at 05:04:19 Pacific
Subject: to create a file of specified size
OS: unix
CPU/Ram: blank
Comment:

Could anybody help me to create an empty file of a specific size limit?..pls let me know what command has to be used for the same.

u123


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: September 29, 2004 at 07:32:16 Pacific
Reply: (edit)

Hi:

There's a little known device called /dev/zero which can quickly create a file of known size. This command:

dd if=/dev/zero of=myfile bs=1024 count=10

creates file "myfile" filled with zeros with a block size of 1000 muliplied 10 tens or 10K.

Regards,

Nails


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge
Poll History




Data Recovery Software