[SunRescue] finding a number of files in a dirB

James Lockwood james at foonly.com
Tue Feb 22 15:28:53 CST 2000


On Tue, 22 Feb 2000, Drew Schatt wrote:

> 	Sorry to reply to my own message, but assuming you know that there are no
> dot-files with only one or two character names, you could do a 
> "/bin/ls -d .??* *|wc -l".  

IMHO this is silly and makes the shell do a lot of work.

ls -A|wc -l will yield the correct count, as will several other
techniques.

     -A        List all entries, including those that begin  with
               a  dot  (.),  with  the  exception  of the working
               directory (.)  and the parent directory (..).

This is regular POSIX.

-James







More information about the rescue mailing list