HDFS命令篇

HDFS

Hadoop查看文件系统

hdfs dfs ls

Found 8 items
drwxrwxrwx - yarn hadoop 0 2016-09-01 04:00 /app-logs
drwxr-xr-x - hdfs hdfs 0 2016-09-01 03:44 /apps
drwxr-xr-x - yarn hadoop 0 2016-09-01 03:42 /ats
drwxr-xr-x - hdfs hdfs 0 2016-09-01 03:42 /hdp
drwxr-xr-x - mapred hdfs 0 2016-09-01 03:42 /mapred
drwxrwxrwx - mapred hadoop 0 2016-09-01 03:42 /mr-history
drwxrwxrwx - hdfs hdfs 0 2016-09-01 03:47 /tmp
drwxr-xr-x - hdfs hdfs 0 2016-09-01 03:59 /user

hadoop root用户下无法创建目录的解决办法

su - hdfs
hdfs dfs -mkdir -p /mp2/links
hdfs dfs -chown -R root:hdfs /mp2/links
exit

Hadoop上传文件

hdfs dfs -put /home/git/spark/README.md /test

你可能感兴趣的:(HDFS命令篇)