Scripting help

Roland Smith rsmith at xs4all.nl
Thu May 12 10:28:30 PDT 2005


On Thu, May 12, 2005 at 11:44:49AM -0500, Chris wrote:
> I would like some advice on how to script something that will search 
> directories below a named root for all files ending with a certain file 
> extension.

Finding files is done (unsurprisingly) with find. E.g. to find all .c
files under the current directory do: 

 find . -name *.c

Find can select files based on many other criteria. See the find manual
page for more detail.  

You can then pipe the output through xargs to do things with the files.

Roland
-- 
R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text.
public key: http://www.xs4all.nl/~rsmith/pubkey.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050512/cec3a00b/attachment.bin


More information about the freebsd-questions mailing list