Question about a ' dd ' command.
James Gray
james at gray.net.au
Fri Mar 7 23:57:21 UTC 2008
On 08/03/2008, at 10:37 AM, Nils Kassube wrote:
> elmo wrote:
>> I read somewhere that these two commands are special application of
>> the basic 'dd' command that will copy and display the transfer
>> action.
>>
>> $ dd if=/dev/zero of=/dev/null& pid=$!
>> $ kill -USR1 $pid; sleep 1; kill $pid
>>
>> I don't understand the null& and pid=$! in the first line and I don't
>> understand any of the second line.
>
> Now you still want to read the man page for the dd command which
> hopefully
> explains the use of the USR1 signal.
Indeed, it does (for the archives):
Sending a USR1 signal to a running `dd' process makes it print I/O
statistics to standard error and then resume copying.
$ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid
18335302+0 records in 18335302+0 records out 9387674624 bytes
(9.4 GB) copied, 34.6279 seconds, 271 MB/s
So, as you alluded to in your message Nils, the dumping of /dev/zero
to /dev/null is quite useless for anything other than benchmarking.
However, it would be interesting to see where the bottle-neck ended
being in this situation; my guess would be that you'd end up CPU
bound ;) I couldn't be bothered digging any deeper; I have to sort
out some SNMP weirdness elsewhere for work :(
Cheers,
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2417 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080308/9ec4c722/attachment.bin>
More information about the ubuntu-users
mailing list