Folder and file sizes using Linux

Hi,

I have ben using Linux for ages and always wanted to know the size of folders when using the command line.

I often used ..


df -h

.. to find how much space was left on the system drives – but what if you were in a sub-directory of your device and wanted to know which folders were the culprits for eating your away at your ~500GB drive…


du -hs *

That code will tell you the disk usage (du), using options to display the results in human readable form (-h) summarizing the folders only (s).

The * will recurse the current directory displaying results for all directories within you current directory.

Enjoy

Advertisements

Post a comment

Please log in using one of these methods to post your comment:

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