How to check which directory is using high disk space in Ubuntu?

directories using high disk space

The du -h <directory> 2>/dev/null | grep '[0-9\.]\+G' command is an invaluable tool for system administrators and users who need to quickly identify which directories are utilizing the most disk space. By replacing <directory> with the desired path, you can quickly view a list of directories that are occupying the most space on your system.

For example, if you wanted to investigate the root path of your system, you could use the command du -h / 2>/dev/null | grep '[0-9\.]\+G' to view a list of the largest directories in the root path. Alternatively, you could use a different directory path altogether.

The du -h <directory> 2>/dev/null | grep '[0-9\.]\+G' command makes it easy to find the largest directories on your system for easy investigation and cleaning. Knowing which directories are consuming the most disk space can help you identify any potential issues, as well as help you make more efficient use of your storage space.

[This blog is written using a tool called Octopost]

anishg Written by:

Hi!, I'm Anish Ghimire. Software Developer based in Kathmandu, Nepal.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *