O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



How many files are there in a directory?
Count the number of files in a directory.

Contributed by:
Unknown User anonymous2
[01/23/04 | Discuss (0) | Link to this hack]

This is a beginners hack to calculate the number of files in a particular directory. ls <path> | wc -l The above command will tell you how many files are listed on the <path> provided. E.g. ls /home/user/images | wc -l will list number of files under images.


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.