Copying Files via `cat` and `dd`
cat
and dd
are standard Unix utilities for handling file data.
cat
outputs the contents of a file tostdout
.dd
readsstdin
(if noif=
) and writes tostdout
or a file.
To copy a file, you can use a Unix pipe (|
) to send cat
's output to dd
, then write to a destination file:
1 |
|
Potential Advantages of cat
and dd
Over cp
Better progress/statistics
dd
with thestatus=progress
(GNU dd) option shows live copy statistics:1
cat bigfile | dd of=outfile status=progress
Working Around cp
Limitations
- Some device files, file descriptors, or pseudo-files (like
/proc
or/sys
) do not supportcp
, but streaming withcat
+dd
may work.
Copying Files via `cat` and `dd`
https://jifengwu2k.github.io/2025/08/12/Copying-Files-via-cat-and-dd/