hadoop基础命令

start-all.sh 启动集群

hadoop fs -ls  默认查看的是/user/grid/下的文件
hadoop fs -mkdir in1 创建文件夹

hadoop fs -ls in1  查看/user/grid/in1文件夹下的内容
hadoop fs -rmr in1 删除文件夹

hadoop fs -touchz in1 创建空文件in1
hadoop fs -rm in1 删除文件

hadoo fs -put wordcount.txt in1 如果in1不存在,这样in1会是一个文件,文件内容是wordcount.txt的内容
hadoop fs -cat in1
hadoop fs -rm in1

hadoop fs -mkdir in1
hadoo fs -put wordcount.txt in1 如果in1存在,并且是个文件夹,则wordcount.txt会放到in1文件夹下
hadoop fs -rmr in1

hadoop fs -touchz in1 创建空文件in1
hadoo fs -put wordcount.txt in1 如果in1存在,并且是个文件,则报错,put: Target in1 already exists
hadoop fs -rm in1


hadoop之helloword:

hadoop fs -mkdir in1

hadoop fs -put wordcount.txt in1

hadoop jar hadoop-examples-1.2.1.jar wordcount in1 out1

hadoop fs -ls out1

hadoop fs -cat part-r-00000

你可能感兴趣的:(hadoop基础命令)