1825689 Members
3809 Online
109686 Solutions
New Discussion

Create a benchmark file

 
SOLVED
Go to solution
Edward McCouch
Frequent Advisor

Create a benchmark file

Hi all.

I need some help. I need to create a benchmark file for testing network response time. The file needs to be 8MB long. I was told to just take a file over 8MB, copy it to the tmp directory and truncate it to 8MB. I suppose that I could spend an 30 minutes and whittle a syslog file to 8MB in vi, but I was hoping that there was an easier way. I did a man on trunc and truncate (my best 2 guesses on what the command might be called) but they don't seem to fit my needs.

OS= HP-UX 11.i

TIA
-Ed
2 REPLIES 2
Robert-Jan Goossens
Honored Contributor
Solution

Re: Create a benchmark file

Hi Ed,

You can create a large file with

# prealloc file 8000000 ( 8 mb )

Hope it helps,

Robert-Jan.
Stefan Farrelly
Honored Contributor

Re: Create a benchmark file

or instead of prealloc you can do;

dd if=/dev/zero of= bs=1024k count=8

(=8MB file)
Im from Palmerston North, New Zealand, but somehow ended up in London...