Hadoop基本操作

下面所有命令都是在windows系统上实践过的

1、格式化文件系统

bin\hdfs namenode -format

2、创建HDFS目录

bin\hdfs dfs -mkdir /user

3、把本地文件拷贝到HDFS

拷贝文件test.txt到user目录下
bin\hdfs dfs -put d:\test.txt /user

查看user目录中是否存在刚
bin\hdfs dfs -ls /user

4、查看目录

bin\hdfs dfs -ls /user

5、查看文件内容

查看test.txt文件的内容
bin\hdfs dfs -cat /user/test.txt

  

  

  

 

  

posted @ 2020-01-15 11:36  StrongerBrother  阅读(201)  评论(0编辑  收藏  举报