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

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership