Category Archives: unix

Checking a directory is empty

#!/bin/bash if [ "$(ls -A $1)" ]; then echo "$1 not empty" else echo "$1 is empty" fi

Posted in unix | Comments Off on Checking a directory is empty