The simple way to copy a folder from HDFS to a local folder is like this:
su hdfs -c 'hadoop fs -copyToLocal /hdp /tmp'
In the example above, we copy the
hdp folder from HDFS to
But we have a more complicated case. Let’s say under
/hdp ( hdfs ), we have subfolders:
/hdp/folder1 /hdp/folder2 /hdp/folder3/folder_a . . .
And in each sub folder we have files.
In that case, how to copy recursively only the files under
/hdp to the local dir