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...
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.
Must Read
Which directory is taking the most space Linux?
Check which folders use the highest disk space in linux
- Command. du -h <dir> 2>/dev/null | grep ‘[0-9. ]+G’ Replace <dir> with your desired directory (for root use / ) …
- Explanation. du -h. Shows the directory and the sizes of each in a human readable format. 2>/dev/null. …
- That’s it. Keep this command in your favorite command lists, it will be needed at really random times.