Editing Dd (command)
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
:<code>oflag=sync</code><ref>https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html#dd-invocation</ref> | :<code>oflag=sync</code><ref>https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html#dd-invocation</ref> | ||
:<code>iflag=[fullblock|nocache]</code> | :<code>iflag=[fullblock|nocache]</code> | ||
− | + | ||
== Examples == | == Examples == | ||
* Write a 10G file with random data: 10 G (<code>bs=10G count=1</code>), with random data (<code>[[/dev]]/[[urandom]]</code>)<ref>https://superuser.com/a/470957</ref>: | * Write a 10G file with random data: 10 G (<code>bs=10G count=1</code>), with random data (<code>[[/dev]]/[[urandom]]</code>)<ref>https://superuser.com/a/470957</ref>: | ||
− | <code>dd iflag=fullblock if=/dev/[[urandom]] of=sample_output_file.txt bs=10G count=1 status= | + | <code>dd iflag=fullblock if=/dev/[[urandom]] of=sample_output_file.txt bs=10G count=1 status=progress</code> |
<pre> | <pre> | ||
10737418240 bytes (11 GB, 10 GiB) copied, 66 s, 162 MB/s | 10737418240 bytes (11 GB, 10 GiB) copied, 66 s, 162 MB/s | ||
Line 17: | Line 17: | ||
10737418240 bytes (11 GB, 10 GiB) copied, 66.4367 s, 162 MB/s | 10737418240 bytes (11 GB, 10 GiB) copied, 66.4367 s, 162 MB/s | ||
</pre> | </pre> | ||
− | |||
− | * Write a 10G with zeroes: 10 G (<code>bs=10G count=1</code>), file with "zeroes" (<code> | + | * Write a 10G with zeroes: 10 G (<code>bs=10G count=1</code>), file with "zeroes" (<code>/dev/zero</code>): |
<code>dd iflag=fullblock if=[[/dev/zero]] of=sample_output_file.txt bs=10G count=1 status=progress</code> | <code>dd iflag=fullblock if=[[/dev/zero]] of=sample_output_file.txt bs=10G count=1 status=progress</code> | ||
<pre> | <pre> | ||
Line 32: | Line 31: | ||
dd: memory exhausted by input buffer of size 10737418240 bytes (10 GiB) | dd: memory exhausted by input buffer of size 10737418240 bytes (10 GiB) | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== Activities == | == Activities == | ||
Line 45: | Line 39: | ||
Advanced | Advanced | ||
− | # Understand iflags, such us | + | # Understand iflags, such us fullblock <code>iflag=fullblock</code> meaning |
# Try to interrupt/kill your command: <code>dd iflag=fullblock if=/dev/urandom of=sample_output_file.txt bs=10G count=1</code> and explain outcome. | # Try to interrupt/kill your command: <code>dd iflag=fullblock if=/dev/urandom of=sample_output_file.txt bs=10G count=1</code> and explain outcome. | ||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | * | + | * [[cp]] and [[rsync]] |
* {{Io performance commands}} | * {{Io performance commands}} | ||
− | * | + | * [[pv]] |
* [[Benchmarking tools]] | * [[Benchmarking tools]] | ||
* {{files}} | * {{files}} |
Advertising: