🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1386

Why use find? (Was: Can U pipe filenames to rm???)

#1386
From: Kim Christian Madsen
Date: Fri, 05 Oct 1990 14:58
23 lines
1563 bytes
george@hls0.hls.oz (George Turczynski) writes:

>Our `find' (SunOS) supports the `-exec' option, and I assume this would be
>fairly common.  So, those of you without xargs, and who | a. can't,  b. don't
>want to | hack `find' use it like this:

>	find {{stuff here}} -exec rm -f {} \;

>Why use `xargs' when you don't need to ?

There are a lot of uses of xargs that are superior to using find with the
exec option. Find is *SLOW*, so if you have the names of files you want to
do something with in a file or pipe use xargs for performance.

Find is also complicated to use for non-trivial tasks, and the syntax  is
often confusing to non-wizards, so specialized shell-scripts or programs
are often more intuitive and faster to create and maintain.

All this is not to bash find(1), which is a wonderful, general tool, however
the multitude of UNIX tools gives you the choice of selecting the one,
most appropriate for your task and the one you're most familiar with.

						Kim Chr. Madsen
Technical Details
Message-ID: <1990Oct5.145825.9454@diku.dk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!snorkelwacker!bloom-beacon!eru!hagbard!sunic!dkuug!freja.diku.dk!kimcm
References: <28790001@col.hp.com> <1977@sixhub.UUCP> <1990Sep30.182331.14363@iconsys.uucp> <941@hls0.hls.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!snorkelwacker!bloom-beacon!eru!hagbard!sunic!dkuug!freja.diku.dk!kimcm
From: kimcm@diku.dk (Kim Christian Madsen)
Newsgroups: comp.unix.shell
Subject: Why use find? (Was: Can U pipe filenames to rm???)
Message-ID: <1990Oct5.145825.9454@diku.dk>
Date: 5 Oct 90 14:58:25 GMT
References: <28790001@col.hp.com> <1977@sixhub.UUCP> <1990Sep30.182331.14363@iconsys.uucp> <941@hls0.hls.oz>
Organization: Department Of Computer Science, University Of Copenhagen
Lines: 23