HDD free space check

Hi,

I need to add a condition in a script. The script is executed only if there is free 8 Gigas space.

I know

if [] then

fi

I don't know how to write the condition on free space

Thanks
:slight_smile:

You can start from here:

 df -h | awk -v _=8 '/ad9/ && $4 ~ "[*G]" && int($4) >= _ {exit _}'
if [ $? -eq 8 ]
  then echo run  # do something here
fi