Can there be a better option?

Hello,

I am still in the process of learning Shell Programming. The online manual, that I am referring to had following question:

I made a script as follows:

df --block-size=1GB | tr -s ' '| cut -d' ' -f2,5 | grep -v 1GB* | sort -k1,2n | tail -1 | cut -d' ' -f2 | cut -d '%' -f1

and it gave me correct result of the free space (in % without the % sign) on my machine's largest partition.

But I am sure that there exists a better and probably shorter script than the one made by me. Can someone provide such a script?

Thanks.

df | gawk 'NR>1 && $5+0<=10'

I've not reached upto gawk yet.

Moreover the script given by you shows just the tmpfs in my machine.. And it's not the largest partition in my system.. It's 975MB in size. And there's no other figure there that's greater than 975. I mean there's a partition that's of 60GB but 60 < 975. That's how it's working, I guess..

Thanks.