Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 Binary Files FileA and FileC

Its is such that FileC = FileA + FileB using the cat utility

How do I subtract FileA from FileC to get FileB ?

share|improve this question
You use cat for binary files? – user unknown Jan 14 '12 at 16:54
I use cat instead of using HJsplit or software like that . – Gautam Jan 14 '12 at 16:58
up vote 3 down vote accepted

Possible using the dd utility:

dd if=FileC of=FileB bs=1 skip=$(stat -c %s FileA)

See man dd for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.