[Next] [Up] [Previous] [Contents]
Next: Terminal input in Up: Miscellaneous tips Previous: Removing files with

Wildcards beyond the working directory

Let's say we want to perform some command on a set of files in the working directory and all the directories below it. What if there was a Hewlett-Packard advertisement that asked, ``What if I had a slew of subdirectories containing mounds of C source code, and I wanted to copy all of the library files (files with a .h extension) into a separate directory called library. How could I do it?'' If you had read the next line, you would respond immediately with the following:[+]


    cp `find . -name '*.h' -print` library

c.c.taylor@ieee.org