X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Subject: RE: find . -regex '.*js' -type f -exec md5sum '{}' \\; really slow!
From: Bartolomeo Nicolotti <bnicolotti@siapcn.it>
To: =?ISO-8859-1?Q?J=F6rg?= Schaible <Joerg.Schaible@scalaris.com>
Cc: cygwin@cygwin.com
In-Reply-To: <1227542582.7201.51.camel@LxPC35>
References: <1227540449.7201.45.camel@LxPC35> 	 <F0D7281DAB048B438E8F5EC4ECEFBDDC0337DE68@esmail.elsag.de> 	 <1227542582.7201.51.camel@LxPC35>
Content-Type: text/plain; charset=UTF-8
Date: Mon, 24 Nov 2008 17:09:01 +0100
Message-Id: <1227542941.7201.55.camel@LxPC35>
Mime-Version: 1.0
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id mAOGAKSD021806

Hi,

but the command

find . -type f  | xargs md5sum

has problems with blanks in the name of the files:

md5sum: ./Pdf/1226503623_Offerta: No such file or directory
md5sum: Speciale: No such file or directory
md5sum: Vilnius.pdf: No such file or directory
md5sum: ./DynPkg/Fly/Old/Copy: No such file or directory
md5sum: of: No such file or directory
md5sum: volisearchstep3.php: No such file or directory
md5sum: ./DynPkg/Fly/Old/Copy: No such file or directory
md5sum: of: No such file or directory
md5sum: ./DynPkg/Fly/Old/Copy: No such file or directory
md5sum: of: No such file or directory
md5sum: flightconfirmandata.php: No such file or directory
md5sum: ./DynPkg/Fly/Old/Copy: No such file or directory
md5sum: of: No such file or directory
md5sum: volisearchstep3.php: No such file or directory
md5sum: ./Pdf/1226503623_Offerta: No such file or directory
md5sum: Speciale: No such file or directory
md5sum: Vilnius.pdf: No such file or directory

Many thanks, best regards.

B.Nicolotti

Il giorno lun, 24/11/2008 alle 17.03 +0100, Bartolomeo Nicolotti ha
scritto:
> Great!
> 
> the command 
> 
> /usr/bin/find . -type f -exec md5sum '{}' \\;
> 
> takes 3min 10s
> 
> the command
> 
> /usr/bin/find . -type f -exec md5sum \{} +
> 
> takes 25s.
> 
> the command
> 
> find . -type f  | xargs md5sum
> 
> takes 17s
> 
> Many thanks, best regards!
> 
> B.Nicolotti
> 
> Il giorno lun, 24/11/2008 alle 16.35 +0100, Jörg Schaible ha scritto:
> > cygwin-owner@cygwin.com wrote:
> > > Hi,
> > > 
> > > I'm using  the command:
> > > 
> > > /usr/bin/find . -type f -exec md5sum '{}' \\;
> > > 
> > > to compare the content of two subtree(161Mbytes) on different systems,
> > > one linux, and the other on windows with cygwin.
> > > 
> > > The command on linux takes some seconds, while on windows+cygwin
> > > takes some minutes. 
> > > 
> > > Could some one help me to speed-up things on windows+cygwin?
> > 
> > Don't run the command for each file, try to use as much files as you can on one line (use '+' instead of ';'):
> > 
> > /usr/bin/find . -type f -exec md5sum \{} +
> > 
> > Hint: A fork is expensive in Cygwin ...
> > 
> > - Jörg
-- 
Bartolomeo Nicolotti
SIAP s.r.l.
www.siapcn.it
v.S.Albano 13 12049
Trinità(CN) Italy
ph:+39 0172 652553
centralino: +39 0172 652511
fax: +39 0172 652519


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


