Categories

Jan 11 in Big Data | Hadoop
Q: How will you check if a file exists in HDFS?

1 Answer

Jan 11

In Hadoop, we can run hadoop fs command with option e to check the existence of a file in HDFS. This is generally used for testing purpose. Command will be as follows:

%>hadoop fs -test -ezd file_uri

e is for checking the existence of file

z is for checking non-zero size of

 

file

d is for checking if the path is directory

Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Nov 8 in Hadoop
Jan 11 in Big Data | Hadoop
Jan 12 in Big Data | Hadoop
...