Hadoop学习记录(二、hdfs shell命令)

在/usr/local/hadoop-2.9.2/bin目录下运行命令

1.查看根目录:

./hdfs dfs -ls /

2.文件上传:上传到根目录

./hdfs dfs -put /tmp/test.txt /

 

3.查看文件内容

./hdfs dfs -cat /test.txt

 

 4.新建文件夹

./hdfs dfs -mkdir /test

5.递归显示文件

./hdfs dfs -ls -R /

 

6.下载文件到当前目录

./hdfs dfs -get /test.txt test2.txt

 

7.删除文件

./hdfs dfs -rm /test.txt

 

8.删除文件夹

./hdfs dfs -rm -R /test

 

猜你喜欢

转载自blog.csdn.net/qq_33283652/article/details/84660359
今日推荐