Gangmax Blog

Count My Blog Post Numbers By Year

Here is the bash command which counts the post numbers I wrote each year.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20; \
do echo "20$i posts count:"; ll source/_posts | grep " 20$i-" | wc -l;\
done

2001 posts count:
1
2002 posts count:
0
2003 posts count:
0
2004 posts count:
0
2005 posts count:
5
2006 posts count:
44
2007 posts count:
39
2008 posts count:
20
2009 posts count:
16
2010 posts count:
30
2011 posts count:
95
2012 posts count:
114
2013 posts count:
65
2014 posts count:
45
2015 posts count:
62
2016 posts count:
69
2017 posts count:
114
2018 posts count:
77
2019 posts count:
62
2020 posts count:
2

The “bash for loop” details come from here.

Comments