Count files in a directory


/ Published in: Bash
Save to your folder(s)

A very simple quick way to count the number of files in a directory.


Copy this code and paste it in your HTML
  1. ls -1 | wc -l
  2.  
  3. ## You can also use find to search recursively and count the returned files:
  4.  
  5. find . -name "*.rhtml" | wc -l

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.