From 74c6c9b01bfd980a01cf9ea6cf32f8d9d3ff47da Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Fri, 18 Apr 2014 17:12:39 +0200 Subject: [PATCH] [DD] Add some tricks for dd --- cheatsheets/dd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cheatsheets/dd b/cheatsheets/dd index c1db5f3..b2a03c8 100644 --- a/cheatsheets/dd +++ b/cheatsheets/dd @@ -2,3 +2,13 @@ # Note: At the first iteration, we read 512 Bytes. # Note: At the second iteration, we read 512 Bytes. dd if=/dev/urandom of=/tmp/test.txt count=512 bs=2 + +# Watch the progress of 'dd' +dd if=/dev/zero of=/dev/null bs=4KB &; export dd_pid=`pgrep '^dd'`; while [[ -d /proc/$dd_pid ]]; do kill -USR1 $dd_pid && sleep 1 && clear; done + +# Watch the progress of 'dd' with `pv` and `dialog` (apt-get install pv dialog) +(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0 + +# DD with "graphical" return +dcfldd if=/dev/zero of=/dev/null bs=500K +