How to copy the output of -text HDFS command into another file?

dewet picture dewet · Aug 22, 2014 · Viewed 7.4k times · Source

Is there any way we can copy text content of hdfs file into another file system using HDFS command:

 hadoop fs -text /user/dir1/abc.txt

Can I print the output of -text into another file by using -cat or any method ?:

 hadoop fs -cat /user/deepak/dir1/abc.txt 

Answer

Aleksei Shestakov picture Aleksei Shestakov · Aug 22, 2014

As it's written in the documentation you can use hadoop fs -cp to copy files in hdfs. You can use hadoop fs -copyToLocal to copy files from hdfs to local file system. If you want to copy files from one hdfs to another then use DistCp tool.