dd

आर्काइव

इस्तेमाल

dd if=<source> of=<target> bs=4M status=progress

ब्लॉक-दर-ब्लॉक नक़ल करता है, इसी से इंस्टॉलर इमेज किसी डिवाइस पर लिखी जाती है; `of=` में जो लिखा है वह बिना किसी पुष्टि के, ब्लॉक शून्य से ऊपर लिख दिया जाता है और वापसी का कोई रास्ता नहीं, इसलिए Enter दबाने से ठीक पहले lsblk से डिवाइस का नाम फिर जाँचें, गति के लिए `bs=4M` लें और चाल देखने के लिए `status=progress` (macOS पर Ctrl+T)।

आम विकल्प

विकल्पअर्थ
if=<file>Input file or device. Leaving it out reads stdin.
of=<file>Output. Whatever this names is overwritten from block zero, with no confirmation.
bs=4MBlock size. Too small and the copy crawls.
count=<n>Copy only n blocks.
status=progressShow progress (GNU). On macOS press Ctrl+T instead.
conv=fsyncFlush to the device before exiting, so the numbers mean something.
conv=notruncWrite in place without truncating the output file.

उदाहरण

lsblk

Always confirm the device name immediately before the next command.

sudo dd if=ubuntu.iso of=/dev/sdb bs=4M status=progress conv=fsync

Write an installer image to a whole USB device (Linux).

diskutil unmountDisk /dev/disk4 && sudo dd if=ubuntu.iso of=/dev/rdisk4 bs=4m

On macOS the disk must be unmounted first, or dd fails with Resource busy; rdiskN is the fast raw path.

बाँधना और दबाना अलग काम हैं: tar बाँधता है, gzip छोटा करता है, और .tar.gz दोनों है।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. dd क्या करता है?

ब्लॉक-दर-ब्लॉक नक़ल करता है, इसी से इंस्टॉलर इमेज किसी डिवाइस पर लिखी जाती है; `of=` में जो लिखा है वह बिना किसी पुष्टि के, ब्लॉक शून्य से ऊपर लिख दिया जाता है और वापसी का कोई रास्ता नहीं, इसलिए Enter दबाने से ठीक पहले lsblk से डिवाइस का नाम फिर जाँचें, गति के लिए `bs=4M` लें और चाल देखने के लिए `status=progress` (macOS पर Ctrl+T)।

Q. इसे कैसे लिखें?

dd if=<source> of=<target> bs=4M status=progress — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 7 दिए हैं; पूरी सूची man dd में है। यह कमांड आर्काइव में आती है।

मिलती-जुलती कमांड

man पेज: man dd