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.128~1^2~22 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=529ea909f454d4a75907ed01dbddfdfec10011d3 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 + +