4 ms·
Interesting, thanks for the hint! Why doesn't the man page say anything about these flags? They are completely obscure becasue of that.
by shmerl 4y ago
Interesting, thanks for the hint!
Why doesn't the man page say anything about these flags? They are completely obscure becasue of that.
- dabiged 4y agoI only found out because I use dd 1000's of times each day and have had to prototype some really esoteric data pipelines using it. I have even compiled a few custom versions to do various tasks. One other nuggets of wisdom which is very poorly documented in the man page: if you have a long running dd process (I often have 12+ hr dd processes reading 10+TB tapes) you can send a USR1 signal to check the progress. Very useful to check if your tape drive has had a hardware failure. Information on both this and the byte counts are in my man page (GNU coreutils 8.30 on Linux Mint 20) around lines 130.
- shmerl 4y agoI knew about USR1 and it's in the man for me too, but I don't see anything about skip_bytes / count_bytes flags, which is strange. Debian testing, coreutils 9.1.
- dabiged 4y agoI am running Coreutils 8.3 on Linux mint 20. It is also in Coreutils 8.22 in RHEL7. https://man7.org/linux/man-pages/man1/dd.1.html https://man7.org/linux/man-pages/man1/dd.1.html Edit: 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.
- shmerl 4y agoThanks for the pointer. So you can simply do something like: dd if=foo skip=nB count=mB bs=4M of=bar To get m bytes from offset n