bin/hadoop fs 具体命令
hadoop fs –ls [文件目录]
eg:hadoop fs –ls /user/wangkai.pt
hadoop dfs –cat [file_path]
eg:hadoop fs -cat /user/wangkai.pt/data.txt
hadoop fs –put [本地地址] [hadoop目录]
eg:hadoop fs –put /home/t/file.txt /user/t
(file.txt是文件名)
hadoop fs –put [本地目录] [hadoop目录]
eg:hadoop fs –put /home/t/dir_name /user/t
(dir_name是文件夹名)
hadoop fs -get [文件目录] [本地目录]
eg:hadoop fs –get /user/t/ok.txt /home/t
hadoop fs –rm [文件地址]
eg:hadoop fs –rm /user/t/ok.txt
hadoop fs –rm [目录地址]
eg:hadoop fs –rm /user/t
eg:hadoop fs –mkdir /user/t
使用touchz命令:
eg:hadoop fs -touchz /user/new.txt
使用mv命令:
eg:hadoop fs –mv /user/test.txt /user/ok.txt (将test.txt重命名为ok.txt)
eg:hadoop fs –getmerge /user /home/t
eg:hadoop job –kill [job-id]
eg:hadoop fs -help rm
eg:hadoop fs -moveFromLocal ./kongming.txt /sanguo/shuguo
eg:hadoop fs -appendToFile liubei.txt /sanguo/shuguo/kongming.txt
eg:hadoop fs -chmod 666 /sanguo/shuguo/kongming.txt
eg:hadoop fs -chown atguigu:atguigu /sanguo/shuguo/kongming.txt
eg:hadoop fs -copyFromLocal README.txt /
eg:hadoop fs -copyToLocal /sanguo/shuguo/kongming.txt ./
eg:hadoop fs -cp /sanguo/shuguo/kongming.txt /zhuge.txt
eg:hadoop fs -tail /sanguo/shuguo/kongming.txt
eg:hadoop fs -mkdir /test
eg:hadoop fs -rmdir /test
eg:hadoop fs -du -s -h /user/atguigu/test
2.7 K /user/atguigu/test
eg:hadoop fs -du -h /user/atguigu/test
1.3 K /user/atguigu/test/README.txt
15 /user/atguigu/test/jinlian.txt
1.4 K /user/atguigu/test/zaiyiqi.txt
eg:hadoop fs -setrep 10 /sanguo/shuguo/kongming.txt
内容来源于网络,如有侵权,请联系作者删除!