Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!bierstadt.scd.ucar.edu!sog From: sog@bierstadt.scd.ucar.edu (Steve Gombosi) Newsgroups: comp.unix.questions Subject: Re: How do I tell when a directory is empty in a script? Message-ID: <10859@ncar.ucar.edu> Date: 1 Apr 91 18:35:12 GMT References: <1991Mar30.040400.13893@ncsu.edu> <563@bria> Sender: news@ncar.ucar.edu Organization: Scientific Computing Division/NCAR, Boulder, CO Lines: 7 `ls $dir|wc -l` doesn't always work. A straight "ls" won't catch the existence of "hidden" files (i.e., files whose name begins with "."). You could have megabytes worth of such files and STILL think the directory was empty. You have to use the -a option to see these files.