Write shell script to to know whether the size of the file provided is greater than zero or zero and print size of file.
This is small script to finding out provided filename size whether it exist or not and if it then findout its size in Byte and print its size using stat -c%s $filename command.
#Progran to Check Size Of File greater than zero or not
#Program from Nullpointer.in
echo "Please Enter File Name:"
if [ -f $filename ]
size=`stat -c%s $filename`
if [ size>0 ]
echo "File size is greater than Zero"
echo "File Size is => $size"
echo "File Size is equal to zero"
echo "File Doesn't Exist......!!!!!"