Lyle
Lyle

Reputation: 111

Linux: Outputting DD results to a text file

I'm writing a script that tests the read and write speeds of my HDD. I've been able to output the read speeds using the hdparm command. I'm using this line to test the write speeds: dd if=/dev/zero of=/tmp/test.data bs=1k count=128k

This outputs to the window:

131072+0 records in 131072+0 records out 134217728 bytes (134 MB) copied, 1.18678 s, 113 MB/s

I tried using >> and > to output the results to the text file and these didn't work. Does anyone know how I can output my results to a text file?

Upvotes: 10

Views: 8731

Answers (2)

user1277476
user1277476

Reputation: 2909

dd's good for sequential writes, but also check into iozone and bonnie. Seeks within a track tend to be far faster than seeks from one track to another, so random I/O can be very different from sequential.

Upvotes: 0

Ben Taitelbaum
Ben Taitelbaum

Reputation: 7403

They're output to stderr, so try using 2> instead of >

dd if=/dev/zero of=/tmp/test.data bs=1k count=128k 2> output.txt

Upvotes: 15

Related Questions