Tech Kraft

Documentum, AWS, Java, Ruby on Rails, Linux, Windows, App Servers


Linux: How to find size of the current directory

In linux, the directory is just a pointer to the location. What we really want if the size of all the files that are contained in that directory. To see the individual sizes of all the directories inside the current directory:

du -sh *

the ‘s’ option provides a summary, the ‘h’ option provides the output in a human readable format. There is a ‘c’ option which can combine the sizes and give a total.

du -h --max-depth=1 | sort -hr

provides the size of all sub-folders at the first level. Sort command sorts the output, with the ‘r’ option meaning ‘reverse’, i.e. the largest one first.

 

 



Leave a comment

About Me

Senior Software Engineer professional with over 16 years of success with multiple open source technologies and various Content Management platforms and solutions.

Proven technical abilities through numerous projects involving enterprise web application design and development, application installation, configuration and support, and workflow and collaboration system designs.

  • Ability to learn new technologies and platforms quickly and apply them to the task at hand.
  • Excellent analytical skills, and strong communication and collaboration abilities.
  • Technical emphasis in including but not limited to Java, Ruby on Rails, Documentum and Alfresco
    in both Linux and Windows based environments

Newsletter