1、新建文件夹
[root@hmm hadoop260]# hdfs dfs -mkdir /mydemo
2、将文件从虚拟机上放到hdfs中
[root@hmm hadoop260]# hdfs dfs -put /opt/user103.log /mydemo/hmm
3、下载文件到本地
[root@hmm hadoop260]# hdfs dfs -get /mydemo/hmm/user103.log /opt/
4、删除文件
[root@hmm hadoop260]# hdfs dfs -rm /mydemo/hmm/user103.log
5、查看文件
[root@hmm hadoop260]# hdfs dfs -cat /mydemo/hmm/bbb.txt
[root@hmm hadoop260]# hdfs dfs -text/mydemo/hmm/bbb.txt
6、统计目录下文件的大小
[root@hmm hadoop260]# hdfs dfs -du /mydemo/hmm
7、删除移动数据和目录
[root@hmm hadoop260]# hdfs dfs -rmr /mydemo
递归删除目录下所有子目录和文件,生产环境中慎用
8、递归的方式给hdfs中的文件夹文件授权
[root@hmm hadoop260]# hdfs dfs -chmod -R 777 /mydemo