Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash script check if enough available disk space

FREE=`df -k --output=avail "$PWD" | tail -n1`   # df -k not df -h
if [[ $FREE -lt 10485760 ]]; then               # 10G = 10*1024*1024k
     # less than 10GBs free!
fi;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #script #check #disk #space
ADD COMMENT
Topic
Name
4+6 =