[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Check if dir is empty



Jacob Friis Larsen, 
> > > How can I check if a directory is empty?
> > use the "ls" command on the dir "man ls"
> 
> Yes, but I need a script to act if there are files in a directory.

if [ -f directory/* ] ; then echo "Files" ; fi

-- 
regards,

Christopher Pharo Glæserud



Reply to: