Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Dec 2003 10:01:19 -0500 (EST)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        homeyra_s@yahoo.com (homeyra g)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: a technical how to
Message-ID:  <200312091501.hB9F1K410582@clunix.cl.msu.edu>
In-Reply-To: <20031209015125.74977.qmail@web14806.mail.yahoo.com> from "homeyra g" at Dec 08, 2003 05:51:25 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> So, I hope this is the right address for this type of
> question. If not would you please forward this and/or
> let me know the correct address.

Is it a text or binary file?

First, I suggest working from a copy of the file for safety sake.

For a text file, Use vi.  Count down to which line is the last one 
you want to get rid of (lets say you want to get rid of 1-1152 and keep
from 1153-end).   Then, in vi, put your cursor on the first line
and do '1152dd'.     save the file off with ':wq'   and voila, you got it.

For a binary file, use dd and tell it to skip the bytes in front
and start copying from there to end to the new file.  You may also have
to play around with blocksize and notrunc to get just what you want if
you need to break it on some odd boundary.

////jerry

> 
> Thanks,
> 
> Here is the question: How to truncate a file from the
> begining to a certain point in the file?
> 
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312091501.hB9F1K410582>