start-all.sh
hdfs dfs -mkdir /ied
hdfs dfs -mkdir -p /luzhou/lzy
hdfs dfs -ls /
,查看根目录(可以在任何节点上查看)hdfs dfs -ls /luzhou
-R
(必须大写)hdfs dfs -ls -R /
test.txt
文件,执行命令:echo "hello hadoop world" > test.txt
(>
:重定向命令)test.txt
文件内容cat test.txt
test.txt
文件到HDFS的/ied
目录。hdfs dfs -put test.txt /ied
hdfs dfs -ls /ied
hdfs dfs -cat /ied/test.txt
test.txt
文件rm -rf test.txt
/ied/test.txt
到本地目录不改名hdfs dfs -get /ied/test.txt
ll test.txt
hdfs dfs -get /ied/test.txt /home/exam.txt
命令:hdfs dfs -rm /ied/test.txt
检查是否删除成功
使用通配符,可以删除满足一定特征的文件
hdfs dfs -rmdir /luhzou
-rmdir
命令不能删除非空目录hdfs dfs -rm -r /luzhou
(-r:recursive)/BigData
,首先创建一个BigData
目录。hdfs dfs -mkdir /BigData
BigData
hdfs dfs -rmdir /BigData