Digital Marketing

Check if File Empty or Not on Linux

#!/bin/bash
 
if [ -s /path/to/myfile.txt ]
then
     echo "File is not empty"
else
     echo "File is empty"
fi

Comments

Popular posts from this blog

Make online money from the Internet