From 529ea909f454d4a75907ed01dbddfdfec10011d3 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 21 Jul 2021 16:20:05 -0400 Subject: [PATCH] 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. --- scripts/files/fast_counter.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/files/fast_counter.sh 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 + + -- 2.34.1