Forum Moderators: bakedjake

Message Too Old, No Replies

Counting all Files Recursively in a Directory?

How to do it?

         

Nick_W

7:40 am on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can this be done using 'ls' or similar?

I need to find out how many files are in a directory that holds many sub-dirs that have sub-dirs etc etc....

Many thanks..

Nick

seindal

9:58 am on Sep 1, 2003 (gmt 0)

10+ Year Member



find YOURDIR -type f ¦ wc -l

Nick_W

10:35 am on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wonderful! - Thanks very much ;)

Nick

seindal

10:50 am on Sep 1, 2003 (gmt 0)

10+ Year Member



find(1) is you friend when you need to work with files in a hierarchy of directories. It has a very awkward syntax, but can do almost everything.

René.