在hdfs中是否有与“pwd”等效的内容? [英] Is there an equivalent to `pwd` in hdfs?
问题描述
我试图做 hdfs dfs -pwd
,但该命令不存在。
因此,目前我正在采取 hdfs dfs -ls ..
,然后是 hdfs dfs -ls ../..
。
I tried to do hdfs dfs -pwd
, but that command does not exist.
So currently I am resorting to doing hdfs dfs -ls ..
followed by hdfs dfs -ls ../..
.
我也查看了 hdfs dfs
的命令列表,但没有看到任何显示有希望的。
I also looked at the command listing for hdfs dfs
but did not see anything that looked promising.
有没有更直接的方法来找到绝对路径?
Is there a more direct way to find the absolute path?
推荐答案
hdfs dfs -pwd不存在,因为在从命令行运行命令时,HDFS中没有工作目录概念。
"hdfs dfs -pwd" does not exist because there is no "working directory" concept in HDFS when you run commands from command line.
你不能在HDFS shell中执行hdfs dfs -cd,然后从那里运行命令,因为HDFS shell和hdfs dfs -cd命令都不存在因此,工作目录的概念是多余的。
You cannot execute "hdfs dfs -cd" in HDFS shell, and then run commands from there, since both HDFS shell and "hdfs dfs -cd" commands do not exist too, thus making the idea of working directory redundant.
您的主目录始终是路径的前缀,除非它以/\".
Your home dir is always the prefix of the path, unless it starts from "/".
这篇关于在hdfs中是否有与“pwd”等效的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!