Personal tools
About this blog
Biological log, aka biolog, aka blog for Hawke
Recent comments
Re:List of sites. hawke 2007-12-18
Re:Onforce hawke 2007-10-29
Re:Linux Distro Evaluations hawke 2007-10-07
hawke 2007-08-25
hawke 2007-08-25
« July 2008 »
Su Mo Tu We Th Fr Sa
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
 
Document Actions

Find and copy *.<ext> from multiple directories into one directory recursively.

I'm getting lazy in my "old age" using GUI too much.
I am still setting up my HP (moving back over from the Dell), and I wanted to move all my various and custom fonts over.
Well, each font is stored in a separate subdirectory, and sometimes sub-sub-sub-directories.
The GUI way would be to tediously go through each directory one at a time (or run the GUi search) and then copy the files over.
But I _knew_ there was an easier way from the command line, but I couldn't remember the syntax.... Had something to do with using find...... Now if i can just _find_ what that was... ;-)

This should work for any/most/all UNIX, Linux, BSD variants. Of course, you must have working versions of "find" and "cp" installed, but that's (almost) certainly the case.

I didn't find the exact answer online, but found enough similar examples to piece together and refresh my memory.

I'm posting it up here in case I forget again (INCONCEIVABLE!), and/or maybe help others out.

(Edit: 2008-05-25)

Sheesh, I forgot to post the actual code when I first posted this blog entry. Here it is:

find . -type f -name '*.TTF' -exec cp {} ../All-Fonts/ \;

 

 

The URL to Trackback this entry is:
http://www.hawkes-haven.com/blahg/find-and-copy-ext-from-multiple-directories-into-one-directory-recursively/tbping
You are here: Home Find and copy *.<ext> from multiple directories into one directory recursively.

Powered by Plone CMS, the Open Source Content Management System

skin by PYBOOM