(General Question) how to count how many files in a directory tree

Chris Kloiber ckloiber at ckloiber.com
Mon May 17 06:25:35 UTC 2004


On Mon, 2004-05-17 at 02:52, Craig Tinson wrote:
> Quick question for you smart bods out there
> 
> I know that "ls -1 | wc -l" will tell me how many files there are in the 
> current directory..
> 
> how would I go about finding out how many files there are in the current 
> directory *and* it's sub directories?

Just guessing...

# find . -type f | wc -l

That is assuming you are looking only for regular files, not
directories, links, devices, sockets, etc.

-- 
Chris Kloiber






More information about the users mailing list