I have a directory which has a lot of header files(.h) and other .o and .c files and other files. This directory has many nested directories inside. I want to copy only header files to a separate directory preserving the same structure in the new directory.
cp -rf oldDirectory newDirectory
will copy all files.
I want to copy only header files.