Using bash to know if a directory is empty

ghostbar
ghostbar
Published in
1 min readFeb 13, 2017

Things I have to learn at work:

if [ ! -z "$(ls -A /path/to/check)" ]; then
echo "Do things here cause it's empty"
fi

--

--