Is there any command in HDFS to check whether a directory is empty or not
count:
hdfs dfs -count /path 1 0 0 /path
The output columns are: DIR_COUNT, FILE_COUNT, CONTENT_SIZE, PATHNAME
DIR_COUNT, FILE_COUNT, CONTENT_SIZE, PATHNAME
du:
hdfs dfs -du -s /path 0 /path
If there are 0 byte files or empty directories, the result would still be 0.
0