I started this blog in May 2020. Today out of curiosity, I wanted to count the number of blog posts that I have written so far on this blog. The posts on this blog are written in markdown and have an extension of
.mdx. Instead of manually counting all the files having
.mdx extension I thought it would be easy to use the
find command. The good part is, it is available on both Linux and MAC operating systems.
So I opened the terminal and changed the directory to blog posts directory (inside this directory all the posts including their respective images are stored).
Next, I used the below command to list down all the files
find . -type f -name "*.mdx"
Below is what I got
Next, step was to count the number of files that were returned by the
find command. To achieve this you need to pipe the previous command with
wc -l as follows
find . -type f -name "*.mdx" | wc -l
wc -l counts the number of lines
So in just a matter of a few seconds, I came to know how lazy I am 😃. I just posted 88 blog posts in one and a half years (~approx).
👉 If you found this post useful, bookmark this page (⌘ + d / ctrl + d) for your future reference 😃