Created
September 2, 2017 17:04
-
-
Save kitmenke/7ea006b4d5a0993285fb6a5671409875 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PARENT_DIR=$1 | |
if [ -z "${PARENT_DIR}" ]; then | |
echo Missing 1 parameter for HDFS parent directory | |
exit 1 | |
fi | |
hdfs dfs -ls ${PARENT_DIR} | awk '{ print $8}' | sed '/^\s*$/d' > dirs.txt | |
echo ' DIR_COUNT FILE_COUNT CONTENT_SIZE PATHNAME' | |
while read dir; do | |
hdfs dfs -count -h $dir | |
done < dirs.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment