From owner-freebsd-questions Mon Jun 17 2:34:41 2002 Delivered-To: freebsd-questions@freebsd.org Received: from spork.pantherdragon.org (spork.pantherdragon.org [206.29.168.146]) by hub.freebsd.org (Postfix) with ESMTP id 3CDDB37B401 for ; Mon, 17 Jun 2002 02:34:36 -0700 (PDT) Received: from spark.techno.pagans (spark.techno.pagans [4.61.202.145]) by spork.pantherdragon.org (Postfix) with ESMTP id 74328471DA for ; Mon, 17 Jun 2002 02:34:35 -0700 (PDT) Received: from pantherdragon.org (speck.techno.pagans [172.21.42.2]) by spark.techno.pagans (Postfix) with ESMTP id 2C09BFEBE for ; Mon, 17 Jun 2002 02:34:32 -0700 (PDT) Message-ID: <3D0DAD27.D0F966CF@pantherdragon.org> Date: Mon, 17 Jun 2002 02:34:31 -0700 From: Darren Pilgrim X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Searching and editting multi-GB binary files? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Anyone know of a way to edit multi-gigabyte binary files? I have some hard disk images, one's 1.2GB, the other 20GB. I need to search them for volume signatures, then snip bytes from both ends of the file to get a volume image prepared for vnode access. I need to be able to actually see certain small parts of the files to get the truncation right, but am not sure how to go about this. How does grep handle large files? Does it read the entire file into memory, or just n*{block|page}size byte at a time, or what? Are there any "read as you go" editors that can handle files that size? Do I even need an editor for this task? Can grep give me all the information I need to use dd/truncate to do this? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message