Chop off end of file

Jonathan Chen jonc at
Sun Jun 26 00:02:47 GMT 2005

On Sun, Jun 26, 2005 at 01:57:33AM +0200, Svein Halvor Halvorsen wrote:
> I have a ~70GB, of which the last ~50GB is garbage. I know exactly at what 
> byte I want to cut the file, but I do not have enough free diskspace to do 
> a 
>    dd if=orig of=pre bs=... count=....
> Is it possible to just chop off the end of a file, without making a copy 
> of its beginning?

truncate(1) is your friend.
Jonathan Chen                      |      To do is to be  -- Nietzsche
<jonc at>                 |      To be is to do  -- Sartre 
                                   |      Scooby do be do -- Scooby

More information about the freebsd-questions mailing list