I have a requirement of finding the directory size which is more than a particular value and I made a script for the same. But find command is not accepting -size section. Can anyone help me on this
echo -e "This script will generate report for directories which consumes more size than the given value"
read -p " Enter the file system or directory full path: " path
read -p " This script will check the directories which is greater than the given size Please Enter the directory size in GB: " size
find $path -type d -size +$sizeG -exec ls -ld {} \;
error
find: invalid -size type `+'
sizeG; you want${size}G, or"$size"G, or"${size}G".-sizeon directories probably doesn't work as you expect. It doesn't count the size of the files inside the directory. You probably need to usedu $pathinstead and filter out the directories you want.dfinstead ofduif you want the size of an entire volume.