Find Out How Much Space A Directory Is Using On Linux / Unix

March 12th, 2008 · 1 Comment

Sometimes it’s useful to be able to find out how much disk space a directory is taking. While there are some web interfaces or desktop applications that allows you to do that, it’s always useful to know how it can be done through a command shell.

The DU Command

To find out how much space is being used, you can use the DU (Disk Usage) command. Here a few examples of the DU command usage.

Listing a disk space summary of directory

# du -sh [directory]

Listing the disk space used for a directory and its subdirectories, sorted by disk usage

# du -h [directory] | sort -rn

Take note that the “h” switch allows displays the disk usage in human readable format (ie. kylobytes, megabytes, etc.).

1 response so far ↓

1. Response by : Find Out How Much Disk Space is Used with cPanel on Jun 26, 2008 at 12:00 am

[...] A couple of months ago, I’ve made a post on how to find how much space a directory is using on Linux. This tutorial was meant for users who have a shell access [...]

Leave a Comment




Posted in Linux · Tutorials | 1 Comment

Dedicated Servers
 
VPS
Website Hosting
 

Recent Comments

Recent Webmasters

Hosting Type :
Monthly Price :
Storage :
Transfer :
Sort By :