From: Chris Koeritz Date: Fri, 30 Mar 2012 16:27:24 +0000 (-0400) Subject: script to count items in Maildir folders. X-Git-Tag: 2.140.90~1458 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=ee72c869e865d41fcd100f61d164f3068416f8d5;p=feisty_meow.git script to count items in Maildir folders. --- diff --git a/scripts/email/count_maildir.sh b/scripts/email/count_maildir.sh new file mode 100644 index 00000000..d9273831 --- /dev/null +++ b/scripts/email/count_maildir.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# counts up the files in each maildir 'cur' folder to find out how many messages are +# held in each subdirectory. + +pushd "$HOME/Maildir" &>/dev/null + +folderlist=$TMP/zz_folder_list.txt + +find . -name "cur" >$folderlist + +while read line; do echo -n "$line -- " ; find "$line" -type f | wc -l ; done < $folderlist + +popd &>/dev/null + +# how to sum the totals... +# another command perhaps. +# bash ~/count_maildir.sh | sed -e 's/.* -- \(.*\)$/\1/' | paste -sd+ | bc +