Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a empty file that is 30 mb? 1

Status
Not open for further replies.

Jonathan777

Technical User
Aug 23, 2001
26
0
0
US
How to use touch command?
 
The touch command will create an empty file or update the date of an existing file. To create a file of a certain size you need to use the mkfile command

e.g mkfile 30m myfile
 
just one more thing, if you need to create large empty file, "mkfile" is very slow, because the file is padded with zeros by default, so in this cases maybe it will be better use something like:

#dd if=/dev/zero of=/myfile bs=1024k count=30

for the 30m example.

Regards,

Carlos Almeida,
 


dd if=/dev/zero of=myfile bs=1024k count=30

if -- input filename
of -- output filename
bs -- block size
count -- number of blocks to write.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top