Original answer: https://stackoverflow.com/questions/8933053/check-duration-of-audio-files-on-the-command-line/74435321#74435321
Full Script
#!/usr/bin/env bash
c=0
NAMEPREFIX=""
DELIMITER="."
TYPEAFFIX="flac"
total=0
for f in *.${TYPEAFFIX}
do
infstr=$(ffprobe -v error -show_entries format=duration -show_entries format_tags=title -sexagesimal -of compact=p=0:nk=1 "$f")
durstr=$(sed -e 's/.*|//' <<< "$infstr")
secstr=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$f" | awk '{printf "%d", $1}')
total=$((total + secstr))
c=$((c + 1))
echo -e "${NAMEPREFIX}${c}${DELIMITER} ${durstr} [$(sed -e 's/\..*//' <<< "$infstr")]"
done
printf "\tTotal Duration: %02d:%02d:%02d\n" $((total/3600)) $(((total%3600)/60)) $((total%60))
Oneliner
c=0; NAMEPREFIX=""; DELIMITER="."; TYPEAFFIX="flac"; total=0; for f in *.${TYPEAFFIX}; do infstr=$(ffprobe -v error -show_entries format=duration -show_entries format_tags=title -sexagesimal -of compact=p=0:nk=1 "$f"); durstr=$(sed -e 's/.*|//' <<< "$infstr"); secstr=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$f" | awk '{printf "%d", $1}'); total=$((total + secstr)); c=$((c + 1)); echo -e "${NAMEPREFIX}${c}${DELIMITER} ${durstr} [$(sed -e 's/\..*//' <<< "$infstr")]"; done; printf "\tTotal Duration: %02d:%02d:%02d\n" $((total/3600)) $(((total%3600)/60)) $((total%60))