Bash unable to create directory

元气小坏坏 提交于 2019-12-12 04:59:11

问题


In docker, I want to copy a file README.md from an existing directory /opt/ibm/labfiles to a new one /input/tmp. I try this

hdfs dfs -put /opt/ibm/labfiles/README.md input/tmp 

to no effect, because there seems to be no /input folder in the root. So I try to create it:

hdfs dfs -mkdir /input
mkdir:'/input': File exists

However, when I ls, there is no input file or directory

How can I create a folder and copy the file? Thank you!!


回答1:


Please try hdfs dfs -ls / if you want to see there is an input folder that exists in HDFS at the root.

You cannot cd into an HDFS directory

It's also worth mentioning that the leading slash is important. In other words,

This will try to put the file in HDFS at /user/<name>/input/tmp

hdfs dfs -put /opt/ibm/labfiles/README.md input/tmp 

While this puts the file at the root of HDFS

hdfs dfs -put /opt/ibm/labfiles/README.md /input/tmp 


来源:https://stackoverflow.com/questions/38589904/bash-unable-to-create-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!