Bash无法创建目录 [英] Bash unable to create directory

查看:292
本文介绍了Bash无法创建目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在docker中,我想将文件 README.md 从现有目录 / opt / ibm / labfiles 复制到新的目录的 /输入的/ tmp 即可。我尝试这个

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!!

推荐答案

请尝试 hdfs dfs -ls / if您希望看到在根目录中存在HDFS中的输入文件夹。

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

您不能将 cd 加入HDFS目录

You cannot cd into an HDFS directory

值得一提的是,领先的斜线是重要的。换句话说,

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

这将尝试将文件放在HDFS中 / user /< name> / input / tmp

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

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

虽然这将文件放在HDFS的根目录

While this puts the file at the root of HDFS

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

这篇关于Bash无法创建目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆