If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Create a 2 GB file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-06, 06:08
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,543
Create a 2 GB file

What is the easiest way to create a 2 GB file ?

I want to see how long this takes on a NFS ..

Thanks in advance

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #2 (permalink)  
Old 10-13-06, 09:59
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,454
Code:
$ yes >/nfsmount/my2gbfile
Reply With Quote
  #3 (permalink)  
Old 10-13-06, 12:23
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,543
funny ;-)
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 10-14-06, 07:22
db2hrishy db2hrishy is offline
Registered User
 
Join Date: Jun 2004
Posts: 115
Hi

Have a look

dd if=/dev/zero of=${ 1} megs bs=10000000 count=$1

try passing different values for $1 and it will create file of different sizes

The value, 2000, is passed to the script and the dd command creates a file called 2000megs with 100 blocks, each 1MB in size, of buffered zeros


you could prefix a tiem in front of it to get the timing information like

time dd if=/dev/zero of=${ 1} megs bs=10000000 count=$1

regards
Hrishy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On