I\'m trying to write a script that will calculate a directory size and if the size is less than 10GB, and greater then 2GB do some action. Where do I need to mention my fol
Use a summary (-s) and bytes (-b). You can cut the first field of the summary with cut. Putting it all together:
-s
-b
cut
CHECK=$(du -sb /data/sflow_log | cut -f1)