So the following command copies from /source/allsubdirectroies (/usr/hdp/2.6.3.0-235) to a /target (/tmp/jar263) folder:
find /usr/hdp/2.6.3.0-235 -type f -name "*.jar" -exec cp {} /tmp/jar263 \; The problem for me is that in the source directory there are files with symbolic link, i.e.: hadoop-nfs.jar -> hadoop-nfs-2.7.3.2.6.3.0-235.jar
So when I check my /tmp/jar263 folder I see the following file:
hadoop-nfs-2.7.3.2.6.3.0-235.jar However what I want is the "hadoop-nfs.jar" name.
Any way to get the link name not the original name of the file?
There are many links in the usr/hdp/2.6.3.0-235/ folder/subfolder structure.
man findand check the options for-type