ProgrammingBashTest if directory emptyTest if a directory is empty As explained here if [ -z "$(ls -A /path/to/dir)" ]; then echo "Empty"else echo "Not Empty"fi