Claus Witt dot com

webdeveloper

I needed to find a way to count the number of files in a directory and only output that number. Bash is still my best friend for this sort of thing - especially with a little help from google.

ls -1 | wc -l

by the way - the answer was 2062 files.

blog comments powered by Disqus