Your Question: How Much Space Does a Directory Take up Linux?
Contents

When listing the contents of a directory using the ls command, you may have noticed that the size of the directories is almost always 4096 bytes (4 KB). That’s the size of space on the disk that is used to store the meta-information for the directory, not what it contains.

How many GB is my Linux directory?

To do so, add -h tag with du command as shown below. Now you see the size of the directories in Kilobytes, Megabytes and Gigabytes, which is very clear and easy to understand. We can also display the disk usage size only in KB, or MB, or GB. The largest sub-directories will be displayed on the top.

Which directory is taking the most space Linux?

Check which folders use the highest disk space in linux

  1. Command. du -h <dir> 2>/dev/null | grep ‘[0-9. ]+G’ Replace <dir> with your desired directory (for root use / ) …
  2. Explanation. du -h. Shows the directory and the sizes of each in a human readable format. 2>/dev/null. …
  3. That’s it. Keep this command in your favorite command lists, it will be needed at really random times.
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest