-test -[defsz]
Answer various questions about
-d return 0 if
-e return 0 if
-f return 0 if
-s return 0 if file
-z return 0 if file
查看文件是否为空,则用-s
hadoop fs -test -s /user/hive/ch_tv_data/usrp_basic_info
if [ $? -ne 0 ]; then
echo "Directory not exists!"
else
echo "OK"
fi