Answers for "sh check if directory is empty"

0

sh check if directory is empty

#!/bin/bash
DIR="/tmp"

if [ "$(ls -A $DIR)" ]; then
     echo "Wow, $DIR is not Empty"
else
    echo "$DIR is Empty"
fi
Posted by: Guest on June-25-2021

Code answers related to "sh check if directory is empty"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language