From owner-freebsd-questions@FreeBSD.ORG Mon Jun 30 22:22:46 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63B9C6BF for ; Mon, 30 Jun 2014 22:22:46 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22AB12C60 for ; Mon, 30 Jun 2014 22:22:45 +0000 (UTC) Received: from r56.edvax.de (port-92-195-69-249.dynamic.qsc.de [92.195.69.249]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id C99133CC42; Tue, 1 Jul 2014 00:22:43 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s5UMMhs9003447; Tue, 1 Jul 2014 00:22:43 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 1 Jul 2014 00:22:43 +0200 From: Polytropon To: Parv Subject: Re: long string using find and "-exec ls -ls" to find part-of filename Message-Id: <20140701002243.2b789c3e.freebsd@edvax.de> In-Reply-To: <20140630214506.GA1606@holstein.holy.cow> References: <20140630045605.GA11147@ethic.thought.org> <53B0EFF2.80205@calorieking.com> <20140630053004.GB16901@ethic.thought.org> <20140630064044.GA25085@ethic.thought.org> <20140630230316.44ec3257.freebsd@edvax.de> <20140630214506.GA1606@holstein.holy.cow> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 22:22:46 -0000 On Mon, 30 Jun 2014 11:45:06 -1000, Parv wrote: > in message <20140630230316.44ec3257.freebsd@edvax.de>, > wrote Polytropon thusly... > > > > On Sun, 29 Jun 2014 23:40:44 -0700, Gary Kline wrote: > > > ANYWAY, the thing learned tonight is that it's *XARGS* > > > instead of -exec abcfubarCmd. > > > > Allow me to add one little reminder: > > > > When using xargs, usually _one_ program will be executed > > with a command line containing _all_ results of the find > > command. If you want to run a program on _each_ of the > > results, this is the typical sh solution: > > > > find ... | while read F; do > > somecommand $F > > done > ... > > If only one command to be run for each file, then xargs can be used > with "-n" option to specify "the maximum number of arguments taken > from standard input for each invocation" ... > > find ... | xargs -n 1 command ... This works! After reading "man xargs" I have re-instantiated my memory about this feature. Thanks for the reminder! :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...