added dir name to make output useful
[feisty_meow.git] / scripts / files / fast_counter.sh
1
2
3 for dir in "${@}"; do
4   echo -n "files in '$dir':"
5   /bin/ls -1fR "$dir" | grep -v "^$" | grep -v "^\.$" | grep -v "^\.\.$" | grep -v ".*:$" | wc -l
6
7     # patterns that remove files from being counted, above:
8     #
9     # ^$       -- all blank lines
10     # ^\.$     -- all lines with just a dot (current directory)
11     # ^\.\.$   -- all lines with just two dots (parent directory)
12     # .*:$     -- all lines that end with a colon (directory heading from recursive ls)
13 done
14
15