공부
[HDFS] check exists & zero file; check directory size
승가비
2021. 1. 8. 23:51
728x90
path=hdfs://a/b/c
hdfs dfs -test -e ${path}
if [ $? -eq 0 ]; then
echo "exists !!!"
fi
hdfs dfs -test -z ${path}
if [ $? -eq 0 ]; then
echo "zero !!!"
fi
size=`hdfs dfs -count ${path} | awk '{print $3}'`
echo $size
Find whether file exists or not in HDFS using shell script
I have a shell script like below. This script prints the path of a file located in HDFS #!/bin/bash TIMESTAMP=`date "+%Y-%m-%d"` path=/user/$USER/logs/${TIMESTAMP}.fail_log path1=/user/$USER/logs...
stackoverflow.com
https://stackoverflow.com/questions/8411180/hadoop-fs-lookup-for-block-size/65631223#65631223
Hadoop fs lookup for block size?
In Hadoop fs how to lookup the block size for a particular file? I was primarily interested in a command line, something like: hadoop fs ... hdfs://fs1.data/... But it looks like that does not e...
stackoverflow.com
728x90