list the size of directories in a mount point
a simple method to list the directories and their sizes in descending order
:/vol/mountpointname_shared
200G 180G 21G 90% /shared
180GB utilised and the user wants to know which dir is comsumingmore space
Responses
To determine which sub-directory of /x/y/z occupies the most space, you could issue the following commands:
cd /x/y/z
du -sm * .??* 2>/dev/null | sort -n
The ".??*" is meant to catch any sub-directories whose names start with a "dot". These commands produce a list of directories with increasing occupation (in MB), provided the user issuing the command has access to all sub-directories.
When doing this kind of query, largeness of objects queried typically has lower adverse impact on the query-speed than the number of objects that have to be queried. When there are scads of small files - particularly with some filesystem-types or if querying a network-share — query-speed can be very slow.
Hello Moosad,
What do you mean by the :/vol/mountpointname_shared?
Is this a network share?
If so, do you have access to the server or NAS box that provides the share?
This would be the place to run the commands provided by Siem, if the server is running a Linux or Unix operating system.
I prefer not run the commands on a NFS or Samba client.
Regards,
Jan Gerrit Kootstra
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
