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 make a file with 1 GB?

Status
Not open for further replies.

AIXRALF

Technical User
Apr 29, 2002
5
0
0
DE
Hello,

have you a script that write a 1 GB file to disk (testdata). I use echo (in a loop), but it is very slow.

echo "$STRING" >> /test.log

Any Idea?

Thank you ...

 
Perhaps you could tar a large directory?? For example tar the /usr directory??

ChrisCW

** Helen Waite is now in charge of all rush orders. If you are in a hurry, just go to Helen Waite.
 
man ls >a
cat a a a a a a a a a a a >b
cat b b b b b b b b b b b >a
cat a a a a a a a a a a a >b
cat b b b b b b b b b b b >a
cat a a a a a a a a a a a >b
cat b b b b b b b b b b b >a
cat a a a a a a a a a a a >b
cat b b b b b b b b b b b >a
cat a a a a a a a a a a a >b
cat b b b b b b b b b b b >a
....
 
Aixralf:

Analogous to /dev/null, unix has a special device called /dev/zero. You can use it to create large files. This dd command example creates a 1Meg file:

dd if=/dev/zero of=bigfile bs=1000 count=1000

Of course, bigfile is just a bunch of zeros with LFs, but it is a large file.

Regards,


Ed
 
Hi:

correction above:

bigfile is just a bunch of zeros with LFs,

should read:

bigfile is just a bunch of zeros withOUT LFs,


Sorry,

Ed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top