finding and copying the files to another location

Hi,
i am trying to copy all the header files from the different folders of
a package and copying them to one single location by find command but
i am unable to find and copy all the files. anybody please help me
out.
find . -name *.h gives the file names but how to copy all the files
to one location?
Thnx in advance
Ujjwal
ujjwal [ Di, 08 April 2008 12:27 ] [ ID #1937605 ]

Re: finding and copying the files to another location

ujjwal wrote:

> find . -name *.h gives the file names but how to copy all the files
> to one location?

find . -type f -name '*.h' -exec cp '{}' /new/location \;

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
PK [ Di, 08 April 2008 12:52 ] [ ID #1937606 ]
Linux » comp.unix.shell » finding and copying the files to another location

Vorheriges Thema: Need script to send me a mail when calculation finishes...
Nächstes Thema: parsing-bash shell-awk