Display Largest Directories In AIX.


In this article we will see how to display the largest directories in AIX system.
As a Administrator, we sometime need to know which directories / files are consuming most of the space on Linux-Unix operating system.

Below command will list the top 10 directories in AIX:

du -ks ./* | sort -rn | head -10

Output will display largest 10 directories in AIX as shown below:

Display Largest Directories in AIX basisguru.com

Let us discuss each term in detail:


The du command displays the number of blocks used for files.

-k flag:

calculates the block count in 1024-byte units, if not specified, by default, block count is calculated in 512 byte units independent of the cluster size by the system.

-s flag:

 reports the total blocks for all specified files or all files in a directory.


This command will display specified number of lines bytes of each of the specified files, or of the standard input.
If no flag is specified by default it will display 10 results.


This command will sort lines in the files specified by the File parameter and writes the result to standard output.

-r Reverses the order of the specified sort.
-n Sorts numeric fields by arithmetic value