shell - Check folder size in Bash -


i'm trying write script calculate directory size , if size less 10gb, , greater 2gb action. need mention folder name?

# 10gb size="1074747474"  # check current size check="`du /data/sflow_log/`" if [ "$check" -gt "$size" ];   echo "done" fi 

you can do:

du -h your_directory 

which give size of target directory


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -