What Linux Folder Is Taking All the Space

The Linux shell provides a lot of helpful commands to analyze your data and manage your system. Here’s a quick sample to get a sorted list of space used by files and folders in your current working directory.

# Get Disk Usage (du) with Block-size of 1M (-BM) 
#   in summary form (-s) 
#   and sort numerically (-n)
du -BM -s * | sort -n
# For a reverse sort, use (-r) option to sort command
# For a partial list, pipe to head or tail command

This is just a quick handy command to get daily work done. I find myself using it frequently.

Advertisements

About notesbytom

Keeping technology notes on WordPress.com to free up my mind to solve new problems rather than figuring out the same ones repeatedly :-).
This entry was posted in Linux, System Administration and tagged . Bookmark the permalink.

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