Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent to `pwd` in hdfs?

Tags:

hadoop

hdfs

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?

like image 494
merlin2011 Avatar asked Feb 03 '14 23:02

merlin2011


People also ask

What are the file permissions in HDFS?

The file or directory has separate permissions for the user that is the owner, for other users that are members of the group, and for all other users. For files, the r permission is required to read the file, and the w permission is required to write or append to the file.

Is there a Hdfs command to see available free space in HDFS?

The -df command shows the configured capacity, available free space and used space of a file system in HDFS.

What is the command used to compare two files in the HDFS directory?

The diff command gives you the differences in an orderly way so content-wise you should be careful to use it in file comparison.

Is Hdfs dfs deprecated?

It is used when we are dealing with different file systems such as Local FS, HDFS etc. It is used when we are dealing for operations related to HDFS. This command should not be used, as it is deprecated. Even if you use it, it will send the command to hdfs dfs.


1 Answers

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 /.

like image 177
Evgeny Benediktov Avatar answered Sep 21 '22 13:09

Evgeny Benediktov