[Novalug] Re: [Ma-linux] How to get the number of files in a given directory

Jay Hart jhart at kevla.org
Wed Jan 9 22:40:08 EST 2008


>> ls | wc -l

In  a directory that I know has 32 files, this returns count of 32.

> # find . -maxdepth 1 -type f | wc -l

this returned a count of 21

>set * ; echo $#

returned a count of 29


Jay




More information about the Ma-linux mailing list