Find the largest Top 10 Files and Directories on Linux/Unix

To find the top 10 files and directories in the current directory, we will use the “du” command with some options, along with the “sort” command to list the sizes in descending order, along with the “head” command to get only the top 10 items.

Example:
(output in K Bytes)

Note the following “du” command options:
-c print the total ==> produce a grand total
-s summarize ==> display only a total for each argument
-k size in K bytes
-m size in M bytes

Another example to produce the output in M Bytes:

Thanks
Ahmed

Advertisement

One thought on “Find the largest Top 10 Files and Directories on Linux/Unix

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 )

Facebook photo

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

Connecting to %s