Copy by extension

Jason Crain jason at
Fri Oct 17 17:01:28 UTC 2008

On Fri, October 17, 2008 11:46 am, Ed Jabbour wrote:
> I'm looking for an app that will descend into a directory and its subs,
> find all files with a .foo extension and copy them to the bar directory.
> There are a lot of files, so doing it manually would be tiresome.  If
> cp has that functionality, I can't find it.  Thanks.

Something like this should work:

find /source/dir/ -iname '*.foo' -exec cp "{}" /dest/dir/ \;

More information about the ubuntu-users mailing list