From owner-freebsd-questions@FreeBSD.ORG Tue Dec 9 07:01:25 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9933316A4CE for ; Tue, 9 Dec 2003 07:01:25 -0800 (PST) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7292243D2A for ; Tue, 9 Dec 2003 07:01:23 -0800 (PST) (envelope-from jerrymc@clunix.cl.msu.edu) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.11.7p1+Sun/8.11.7) id hB9F1K410582; Tue, 9 Dec 2003 10:01:20 -0500 (EST) From: Jerry McAllister Message-Id: <200312091501.hB9F1K410582@clunix.cl.msu.edu> To: homeyra_s@yahoo.com (homeyra g) Date: Tue, 9 Dec 2003 10:01:19 -0500 (EST) In-Reply-To: <20031209015125.74977.qmail@web14806.mail.yahoo.com> from "homeyra g" at Dec 08, 2003 05:51:25 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: a technical how to X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2003 15:01:25 -0000 > > 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" >