If you’re a DevOp or a just regular user who manages their Linux/Unix servers, it’s a recurring task where you would need to keep an eye on the size of the subdirectories and files of your project. It all takes a single command consisting of https://en.wikipedia.org/wiki/Du_(Unix) that lists all the important stuff that you would need. So, for instance, if I want to list the size of all the subdirectories and files for one of my projects called https://github.com/amitmerchant1990/notepad in ascending order of the size, here’s how I can do that.
https://www.amitmerchant.com/images/du-usage.png As you can tell, the command estimates file space usage of all the subdirectories and files which can be specified using the *.
Ultimately, we can then pipe the output of this command to sort which will sort the files and directories based on the memory they occupy.