//话不多说先上代码
hdfs dfs -get hdfs://host:port/user/hadoop/file localfile
其中hdfs://host:port/user/hadoop/file是指你的文件路径,localfile指你的本地路径
比如我在hdfs的/input目录下有一个名为test.txt文件,我现在想将它复制到我的桌面上(该虚拟机名为hadoop)
代码为:
hdfs dfs -get /input/test.txt /home/hadoop/Desktop
这样就实现了将指定文件复制到我的桌面上的操作