Showing the size of a directory using command line in Mac OSX

Today I learned that there’s a command to let us list down the breakdown of the size of each folder:

~/Desktop $ du -h features 
12K   features/step_definitions 
12K   features/support 
32K   features

We can also show the total size of a directory by doing this:

~/Desktop $ du -hc ~/Desktop/ |grep total 4.8G total 
4.8G   total

A useful command to find out breakdown of current directory!

du -cd 1 ./ | sort -nr |head
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s