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
Post a Comment