数据存在hdfs-site的dfs.datanode.data.dir
hdfs主目录:/tmp/hadoop-test/dfs/data
展示所有
bin/hdfs dfs -ls -R /
查看
bin/hdfs dfs -cat /README.txt
bin/hdfs dfs -text /README.txt
上传
bin/hdfs dfs -put NOTICE.txt /
新建文件
bin/hdfs dfs -touchz /111
创建目录
bin/hdfs dfs -mkdir -p /test/1
删除文件和目录
bin/hdfs dfs -rm -r /test1
删除文件
bin/hdfs dfs -rm /test.txt
复制到dfs
bin/hdfs dfs -copyFromLocal ~/print.sh /test/1
移动到dfs
bin/hdfs dfs -moveFromLocal ~/print.sh /test
查看大小
bin/hdfs dfs -du -h /
bin/hdfs dfs -du -h /test.txt
更细节的查看大小
bin/hdfs dfs -df -h /
移动
bin/hdfs dfs -mv /test/print.sh /
下载
sudo bin/hdfs dfs -get /print.sh /opt
修改权限
bin/hdfs dfs -chmod -R 777 /