Convert a file while copying it (UNIX)
dd [if=input_file] [of=output_file] [options]
- Read from input_file instead of the standard input.
- Write to output_file instead of the standard output. Unless
conv=notrunc is given, truncate the file to the size
specified by seek= (0 bytes if seek=
- Read bytes bytes at a time.
- Write bytes bytes at a time.
- Read and write bytes bytes at a time.
Override ibs and obs.
- Convert bytes bytes at a time.
- Skip blocks ibs-sized blocks
at start of input.
- Skip blocks obs-sized blocks at
start of output.
- Copy only blocks ibs-sized
- Convert the file as specified by the conversion arguments.
- Convert EBCDIC to ASCII.
- Convert ASCII to EBCDIC.
- Convert ASCII to alternate EBCDIC.
- Pad newline-terminated records to size
of cbs, replacing
newline with trailing spaces.
- Replace trailing spaces in
cbs-sized block with
- Change uppercase characters to lowercase.
- Change lowercase characters to uppercase.
- Swap every pair of input bytes. Unlike
the UNIX dd, this works when
an odd number of bytes are read. If the
input file contains an odd number of
bytes, the last byte is simply copied
(since there's nothing to swap it with).
- Continue after read errors.
- Don't truncate the output file.
- Pad every input block to size of
ibs with trailing NULs.
You can follow all numbers by a multiplier:
- Blocks (×512).
- Kbytes (×1024).
- Words (×2).
- Multiply by m.
utility copies a file (from the standard input to the standard output, by default)
with a user-selectable blocksize, while optionally performing conversions
on it. It's meant for writing raw data directly to devices such as
tape and disk or writing over the network, with control over blocking
factors and character set translations.
||This utility is subject to the GNU Public License (GPL).
We've included it for use on development systems.|
You can use this command for copying partial files.
You can specify the block size, skip count, and the number of blocks to copy.
Sizes are in bytes by default;
you can append the letters w, b, or k to the
number to indicate words (2 bytes), blocks (512 bytes), or K (1024 bytes).
When dd is finished, it reports the number of full and
partial blocks read and written.
Copy file file1 to file2, converting
all text to lowercase letters:
dd if=file1 of=file2 conv=lcase
- An error occurred.
- The copy and translation operation was successful.