HDFS常用命令--Hadoop学习笔记
其他
2021-02-01 04:38:15
阅读次数: 0
HDFS
常用命令
- 启动集群hdfs:sbin/start-dfs.sh
- 启动集群yarn:sbin/start-yarn.sh
- help:hadoop fs -help rm
- 显示目录信息:hadoop fs -ls /
- 在HDFS上创建目录:hadoop fs -mkdir -p /user
- 本地剪切到HDFS:hadoop fs -moveFromLocal x.txt /user
- 追加文件到另一个已存在文件的末尾:hadoop fs -appendToFile x.txt /user/xx.txt
- 显示:hadoop fs -cat x.txt
- 移动文件:hadoop fs -mv x.txt /user
- 下载到本地:hadoop fs -copyToLocal x.txt /local或者hadoop fs -get x.txt /local
- 删除文件或文件夹:hadoop fs -rm x.txt
- 删除空目录:hadoop fs -rmdir /user
- 设置HDFS文件副本数量:hadoop fs -setrep num x.txt
转载自blog.csdn.net/liuliusix/article/details/109293919