dd
압축·전송
쓰는 꼴
dd if=<source> of=<target> bs=4M status=progress블록 단위로 그대로 복사해 디스크 이미지를 쓰거나 굽습니다 — `of=`에 적은 대상은 확인 한 번 없이 0번 블록부터 덮어써지고 되돌릴 방법이 없으니, 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=4M | Block size. Too small and the copy crawls. |
| count=<n> | Copy only n blocks. |
| status=progress | Show progress (GNU). On macOS press Ctrl+T instead. |
| conv=fsync | Flush to the device before exiting, so the numbers mean something. |
| conv=notrunc | Write in place without truncating the output file. |
예시
lsblkAlways confirm the device name immediately before the next command.
sudo dd if=ubuntu.iso of=/dev/sdb bs=4M status=progress conv=fsyncWrite an installer image to a whole USB device (Linux).
diskutil unmountDisk /dev/disk4 && sudo dd if=ubuntu.iso of=/dev/rdisk4 bs=4mOn 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=`에 적은 대상은 확인 한 번 없이 0번 블록부터 덮어써지고 되돌릴 방법이 없으니, 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