From owner-freebsd-questions@FreeBSD.ORG Mon Jun 30 21:40:42 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 55AEA6BC for ; Mon, 30 Jun 2014 21:40:42 +0000 (UTC) Received: from p3plsmtpa07-01.prod.phx3.secureserver.net (p3plsmtpa07-01.prod.phx3.secureserver.net [173.201.192.230]) by mx1.freebsd.org (Postfix) with ESMTP id 0EAB42838 for ; Mon, 30 Jun 2014 21:40:41 +0000 (UTC) Received: from ethic.thought.org ([209.180.213.209]) by p3plsmtpa07-01.prod.phx3.secureserver.net with id Llf21o00N4XeM0101lf3fj; Mon, 30 Jun 2014 14:39:04 -0700 Date: Mon, 30 Jun 2014 14:39:09 -0700 From: Gary Kline To: Polytropon Subject: Re: long string using find and "-exec ls -ls" to find part-of filename Message-ID: <20140630213909.GA21861@ethic.thought.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140630230316.44ec3257.freebsd@edvax.de> User-Agent: Mutt/1.5.21 (2010-09-15) 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 21:40:42 -0000 ===== Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 27++ years of service to the Unix community. On Mon, Jun 30, 2014 at 11:03:16PM +0200, Polytropon wrote: > 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 > > Or maybe less elegant: > > for F in `find ...`; do > somecommand $F > done > > But keep in mind things get more complicated when the file > names contain valid, but "unpleasant" characters, such as > spaces. In this case, reading this can help: > > David A. Wheeler: > Filenames and Pathnames in Shell: How to do it Correctly > http://www.dwheeler.com/essays/filenames-in-shell.html > > David A. Wheeler: > Fixing Unix/Linux/POSIX Filenames: > Control Characters (such as Newline), Leading Dashes, > and Other Problems > http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html > > But if you've been using "clean" file names, this shouldn't > be a big problem. ;-) I hope everything is online so that I can blow up the font size! my eyesight keeps getting worse; and , yes, I do need new specs. Any other book-length style on "UNIX toolbox" would be a big help. ive got about 15-20 find examples and most use "-exec" foob {} \; or whatever. I kept trying to use ls -lsi AND -exec. Zip. One totally OT thing. my sysadmin is or will be on his honeymoon but installed FBSD 10.X. without ports. do you know what magic command I use to install the entire ports tree? the BSD installation is somehow on my server box. he has it set up for me to get over there with an alias. but nothing's therebut 10. > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix Twenty-seven years of service to the Unix community.