< Notes...

This bash code is what I use to count the amount of notes per year, ever since I started babbling in here. I first move to the content/posts/ directory, then run it. It works great under macOS.

for file in *.md; do \
    head -n 5 "$file" | \
    grep 'date:' | \
    sed 's/date.*\([[:digit:]]\{4\}\).*/\1/' >> count; \
done && \
cat count | sort | uniq -c && \
rm count
< Older Newer >