Finding files by Extention in a CLI

Matthew Miller mattdm at mattdm.org
Fri Feb 11 18:18:39 UTC 2005


On Fri, Feb 11, 2005 at 12:13:23PM -0600, H. Streit wrote:
> Okay, so I've just copied over a bunch of files and I want to find all 
> .com/.COM/.Com files...
> I thought "find . -print|grep -i ".com" would work, tried a few 
> variants, but I know I'm doing something wrong...any takers?

That will work, except it matches anything which contains the string "com"
preceded by any character. It's also inefficient since the find command
itself can do the filtering. Try this:

  find . -iname '*.com'


-- 
Matthew Miller            mattdm at mattdm.org        <http://www.mattdm.org/>
-->  Fedora Users & Developers Conference, hosted by Boston University  <--
February 18th, 2005                       <http://fedoraproject.org/fudcon/>  




More information about the fedora-list mailing list