dd】 转换和复制文件【linux】


从{/dev/urandom}中读取2*512字节,并将其放入{/tmp/test.txt}。

注意:在第一次迭代时,我们读取512字节。

注意:在第二次迭代时,我们读取512字节。

dd if=/dev/urandom of=/tmp/test.txt count=512 bs=2

观察 "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

用 "pv "和 "dialog "观察 "dd "的进度 (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

用 "pv "和 "zenity "观察 "dd "的进度 (apt-get install pv zenity)

(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | zenity --title 'Running dd command (cloning), please wait...' --progress

用内置的 "progress "功能观察 "dd "的进度(在 coreutils v8.24 中引入)

dd if=/dev/zero of=/dev/null bs=128M status=progress

用 "图形 "返回DD

dcfldd if=/dev/zero of=/dev/null bs=500K

这将从你的麦克风端口输出声音到ssh目标计算机的扬声器端口。声音质量很差,所以你会听到很多嘶嘶声

dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp

不间断地显示当前进度(USR1)

dd if=/dev/zero of=/dev/null & pid=$!

kill -USR1 $pid

dd】 mainly used for copying and converting data【linux】


Read from {/dev/urandom} 2*512 Bytes and put it into {/tmp/test.txt}

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

Watch the progress of 'dd' with pv and zenity (apt-get install pv zenity)

(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | zenity --title 'Running dd command (cloning), please wait...' --progress

Watch the progress of 'dd' with the built-in progress functionality (introduced in coreutils v8.24)

dd if=/dev/zero of=/dev/null bs=128M status=progress

DD with "graphical" return

dcfldd if=/dev/zero of=/dev/null bs=500K

This will output the sound from your microphone port to the ssh target computer's speaker port. The sound quality is very bad, so you will hear a lot of hissing.

dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp

Show current progress without interruption (USR1)

dd if=/dev/zero of=/dev/null & pid=$!

kill -USR1 $pid


腾图小抄 SCWY.net v0.03 小抄561条 自2022-01-02访问370586次