c85723e9cde64ec394e0f15b3b8d9ff756b81aa3
[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 ".*:$" | grep -v "\.snapshot" | 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     # \.snapshot   -- all lines mentioning the snapshot directory.
14 done
15
16