PDA

View Full Version : look if the directory is empty in bash



cazz
July 21st, 2007, 08:04 PM
How can I make so the bash file can see if a directory is empty or not.

Mr. C.
July 21st, 2007, 08:48 PM
if [ $(ls -1A | wc -l) -eq 0 ]; then
echo Empty
fi

MrC