3 ms·
dd does all you want without a new version. dd allows you to specify your seek, skip and count values as bytes instead of blocks using the iflag/oflag options
by dabiged 4y ago
dd does all you want without a new version.
dd allows you to specify your seek, skip and count values as bytes instead of blocks using the iflag/oflag options seek_bytes, skip_bytes and count_bytes.
So to read the first MB of data 100GB into a file you can:
> dd if=/tmp/file1 bs=2M skip=100G count=1M iflag=count_bytes,skip_bytes
- kelnos 4y agoWhich 'dd' is that? Coreutils 9.1 on Debian testing here, and the 'dd' manpage doesn't metion count_bytes or skip_bytes at all.
- dabiged 4y agoI am running Coreutils 8.3 on Linux mint 20. It is also in Coreutils 8.22 in RHEL7. Edit: https://man7.org/linux/man-pages/man1/dd.1.html https://man7.org/linux/man-pages/man1/dd.1.html Edit 2 : I just found this in the coreutils 9.0 changelog: dd now counts bytes instead of blocks if a block count ends in "B". For example, 'dd count=100KiB' now copies 100 KiB of data, not 102,400 blocks of data. The flags count_bytes, skip_bytes and seek_bytes are therefore obsolescent and are no longer documented, though they still work.