Gangmax Blog

自由之思想,独立之精神

Count My Blog Post Numbers By Year

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

1
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20; \
2
do echo "20$i posts count:"; ll source/_posts | grep " 20$i-" | wc -l;\
3
done
4
5
2001 posts count:
6
       1
7
2002 posts count:
8
       0
9
2003 posts count:
10
       0
11
2004 posts count:
12
       0
13
2005 posts count:
14
       5
15
2006 posts count:
16
      44
17
2007 posts count:
18
      39
19
2008 posts count:
20
      20
21
2009 posts count:
22
      16
23
2010 posts count:
24
      30
25
2011 posts count:
26
      95
27
2012 posts count:
28
     114
29
2013 posts count:
30
      65
31
2014 posts count:
32
      45
33
2015 posts count:
34
      62
35
2016 posts count:
36
      69
37
2017 posts count:
38
     114
39
2018 posts count:
40
      77
41
2019 posts count:
42
      62
43
2020 posts count:
44
       2

The “bash for loop” details come from here.

Comments