hadoop shell

http://blog.163.com/jiayouweijiewj@126/blog/static/171232177201081994553310/

判断文件是否存在

hadoop fs -test -e /hdfs_dir

if [ $? -ne 0 ]; then

    echo "Directory not exists!"

fi

if [ $? -ne 1 ]; then

    echo "Directory exists!"

fi

posted @ 2014-09-04 15:48  孤魂野鬼hg  阅读(80)  评论(0编辑  收藏  举报