Michael Bevilacqua on 2 Jul 2009 12:55:28 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] add symlink to directory with find -name -exec {} \;


On Thu, Jul 2, 2009 at 3:39 PM, JP Vossen <jp@jpsdomain.org> wrote:
In general you want to avoid using '-exec {} \;' because it's terribly
inefficient since it guarantees that you spawn a sub-shell for every
single file you find.  *Often* a better way is this (assume GNU tools):
       find -name script_name -print0 | xargs -0 chmod 200

Note, there is a way to perform this in find(1) without piping to xargs(1):


find . -name script_name -exec chmod 200 {} + ;/


Man page for more details.


--
Michael D. Bevilacqua
michael@bevilacqua.us
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug