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

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -