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 ../..
.
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
does not exist because there is no "working directory" concept in HDFS when you run commands from command line.
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 /
.