Checking if directory in HDFS already exists or not
Hadoop fs is deprecatedUsage: hdfs dfs -test -[ezd] URI
Options:The -e option will check to see if the file exists, returning 0 if true.The -z option will check to see if the file is zero length, returning 0 if true.The -d option will check to see if the path is directory, returning 0 if true.Example: hdfs dfs -test -d $yourdir
Please check the following for more info: https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/FileSystemShell.htmlRegards