Skip to content

Instantly share code, notes, and snippets.

@cabecada
Created November 30, 2025 17:34
Show Gist options
  • Select an option

  • Save cabecada/54e22d72f3cae38aad16036c6c3c09e2 to your computer and use it in GitHub Desktop.

Select an option

Save cabecada/54e22d72f3cae38aad16036c6c3c09e2 to your computer and use it in GitHub Desktop.
dd quickref
https://medium.com/@pranavt84/postgresql-page-structure-a-deep-dive-e82094a613de
seek= how far you go ahead in the output file
skip= how far you go ahead in the input file
count= how many segments you copy (can be set via bs=)
say you have 2 16 byte files like so:
file1: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
file2: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
heres some commands and sample outputs:
dd if=file1 of=file2 count=12 bs=1 seek=4
file2: 01 01 01 01 [00 11 22 33 44 55 66 77 88 99 AA BB]
dd if=file1 of=file2 count=12 bs=1 skip=4
file2: [44 55 66 77 88 99 AA BB CC DD EE FF] 01 01 01 01
dd if=file1 of=file2 count=12 bs=1 skip=4 seek=4 count=8
file2: 01 01 01 01 [44 55 66 77 88 99 AA BB] 01 01 01 01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment