----- Original Message ----- From: "J. Rafael Sanchez" <[EMAIL PROTECTED]> Date: Friday, October 31, 2003 3:21 pm Subject: (clug-talk) 'dd' on linux question...
> Hey guys, > > I have a huge file that needs to be edited using a hex editor. > Right now > i'm using khexedit. The only problem is that this is a multiuser > environmnet and every time the file is loaded it uses 80 to 90% of > memory. It loads the "whole" file into memory. Everyone else's > processessuffer because of it. > > The section of the file that needs to be edited is the first 2k. To > extract this section and read it into the editor, make the changes is > not a problem. The challenge comes in now that I want to put it > back at > the begining of the file. > > to extract, > $ dd if=pathtoverybigfile of=pathtosectionoffile bs=2k count=1 > > How to reverse this so that a put the changed section back into the > origfile? > > Thanks guys. > > Rafael. > I would continue like this: dd if=pathtoverybigfile skip=1 bs=2k | cat pathtosectionoffile - >temp ;only if everything is ok then perform the following mv temp pathtooverlybigfile
