How to calculate size of your application

Have you ever been interested how many files your application consists of? Or how many lines have you and your developers have written in this app? Here is how to easily count them.

GNU find, cat and wc commands used below are installed on OS X and Linux by default.
Although the ports to Windows do exist, I have not tested them because I do not have a Windows computer with Ext project. Hence, I welcome comments from Windows users very much.

Calculate number of files

This command descend to app, ux, overrides, sass and packages/mytheme directories to find JavaScript and Sass files.

If you have your sources in some additional directories just add them to the list, or remove theme directory from the list if you don’t use a custom theme. Similarly, if you want to count, for example, PHP files, add them to the list of extensions in the regex expression: -regex '.*\.(js|scss|php)'

The file names are then piped (|) to wc command – which, by the way, stands for “word count”, not for “water closet” – that with -l switch counts lines, in this case files.

The output is a single number giving you the number of files matching the find conditions. In one of the projects I’ve supervised recently it was 1047.

Calculate number of lines

It is very similar, we only need to concatenate the content of files before we pipe it to wc command. Thus:

Again, output is a single integer. In my case it was 146,206.

Feel free to post your results in comments.

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Pin on PinterestEmail this to someone
Follow me:


I'm a well seasoned developer, consultant and educator of web applications based mainly on Sencha libraries, PHP, MySQL and Node.js. Besides (Apple) computers, I love photography and mountain biking.
Follow me:

Latest posts by Saki (see all)


  1. says

    I see your website needs some unique & fresh articles.
    Writing manually is time consuming, there is tool for this task.
    Just search in gogle for: Fejlando’s tips

We will be happy to hear back from you

Please Login to post a comment