From owner-freebsd-questions@FreeBSD.ORG Mon Mar 4 11:29:32 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5F9E3B8 for ; Mon, 4 Mar 2013 11:29:32 +0000 (UTC) (envelope-from steve@sohara.org) Received: from uk1rly2283.eechost.net (relay01a.mail.uk1.eechost.net [217.69.40.75]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB641155 for ; Mon, 4 Mar 2013 11:29:32 +0000 (UTC) Received: from [31.186.37.179] (helo=smtp.marelmo.com) by uk1rly2283.eechost.net with esmtpa (Exim 4.72) (envelope-from ) id 1UCTaQ-0004ib-7r; Mon, 04 Mar 2013 11:29:42 +0000 Received: from [192.168.63.1] (helo=steve.marelmo.com) by smtp.marelmo.com with smtp (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1UCTaD-000NdI-S9; Mon, 04 Mar 2013 11:29:29 +0000 Date: Mon, 4 Mar 2013 11:29:00 +0000 From: Steve O'Hara-Smith To: freebsd-questions@freebsd.org Subject: Re: Grepping though a disk Message-Id: <20130304112900.660b3e29dbec8f2f60fffa9b@sohara.org> In-Reply-To: <20130304121524.63685108.freebsd@edvax.de> References: <20130304013608.7981e8a9.freebsd@edvax.de> <51347454.5060605@gmail.com> <20130304121524.63685108.freebsd@edvax.de> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Auth-Info: 15567@permanet.ie (plain) Cc: Polytropon X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 11:29:32 -0000 On Mon, 4 Mar 2013 12:15:24 +0100 Polytropon wrote: > But I don't know how to do this. From reading "man dd" > my impression (consistent with my experience) is that > the option skip= operates in units of bs= size, so I'm > not sure how to compose a command that reads units of > 1 MB, but skips in units of 950 kB. Maybe some parts of > my memory have also been marked "unused" by fsck. :-) Not too hard (you'll kick yourself when you read down) - translation to valid shell script is left as an exercise for the reader :) bs=50k count=(n*20) skip=(n*20 - 1) Probably nicer to use powers of 2 bs=64k count=(n*16) skip=(n*16 - 1) -- Steve O'Hara-Smith