Is there any command in HDFS to check whether a directory is empty or not
isEmpty=$(hdfs dfs -count /some/path | awk '{print $2}') if [[ $isEmpty -eq 0 ]];then echo "Given Path is empty" #Do some operation else echo "Given Path is not empty" #Do some operation fi