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/ \;
- Category(s)
-
Nix
-
Technology
- 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