The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: creating data of size
Hopper
Newbie
Rank: 1



UID 176
Digest Posts 0
Credits 0
Posts 58
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 7, 2007 06:53 AM  Profile | P.M. 
creating data of size



creating data of size



hello,

i need to create 100kb,1000kb,10000kb etc files of no particular substance but i need them a exact size.


i think they are .dat's i need but im unsure of the command i issue to create them

any help appreciated


Top
dewouter
Newbie
Rank: 1



UID 115
Digest Posts 0
Credits 0
Posts 63
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 7, 2007 06:54 AM  Profile | P.M. 
find first 100kb file and then "man dd"
Top
jacklefataliste
Newbie
Rank: 1



UID 194
Digest Posts 0
Credits 0
Posts 39
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 7, 2007 06:54 AM  Profile | P.M. 
you could use dd to create the 100k file by sourcing /dev/urandom
Top
clvezlys
Newbie
Rank: 1



UID 92
Digest Posts 0
Credits 0
Posts 44
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 7, 2007 06:54 AM  Profile | P.M. 
try this



use mkfile. gets you exacts.

mkfile
usage: mkfile [-nv] <size>[g|k|b|m] <name1> [<name2>] ...

ex:

mkfile 1024m testfile

exact.
Top
haynesey
Newbie
Rank: 1



UID 172
Digest Posts 0
Credits 0
Posts 34
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 7, 2007 06:54 AM  Profile | P.M. 
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.
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:41 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005760 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP