Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2009 01:59:36 -0800
From:      perryh@pluto.rain.com
To:        wblock@wonkity.com, glarkin@freebsd.org
Cc:        mexas@bristol.ac.uk, freebsd-questions@freebsd.org
Subject:   Re: editing a binary file
Message-ID:  <4b2b5288.qFxIl6ScdS9yKkZj%perryh@pluto.rain.com>
In-Reply-To: <4B2ADE9E.6080707@FreeBSD.org>
References:  <20091218005102.GA51064@mech-cluster241.men.bris.ac.uk> <alpine.BSF.2.00.0912171820130.53881@wonkity.com> <4B2ADE9E.6080707@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Greg Larkin <glarkin@freebsd.org> wrote:
> ...
> > truncate -4 myfile should get rid of the last four bytes.  Maybe
> > there's a similar efficient way to truncate the start of a file.
>
> This should do it:
>
> dd if=oldfile of=newfile bs=1 skip=4

Or, perhaps marginally more efficient:

dd if=oldfile of=newfile bs=4 skip=1



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4b2b5288.qFxIl6ScdS9yKkZj%perryh>