From: Chris Koeritz Date: Wed, 21 Jul 2021 20:20:05 +0000 (-0400) Subject: simple script to count number of files in a directory X-Git-Tag: 2.140.134~12^2~22 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=ff0a471959e20771280f16cbc38237433c0f602d;p=feisty_meow.git simple script to count number of files in a directory doesn't include directories. may not be perfect; does look for lines ending in a colon, to remove directory headings from recursive ls list. --- diff --git a/scripts/files/fast_counter.sh b/scripts/files/fast_counter.sh new file mode 100644 index 00000000..c40e33a3 --- /dev/null +++ b/scripts/files/fast_counter.sh @@ -0,0 +1,7 @@ + + +for dir in "${@}"; do + /bin/ls -1fR "$dir" | grep -v "^$" | grep -v "^\.$" | grep -v "^\.\.$" | grep -v "$dir\/.*:$" | wc +done + +