Linked Questions

6
votes
2answers
671 views

Why is the size of a directory either 0 or 4096? [duplicate]

$ ls -l total 28 drwxrwxrwx 1 t t 4096 May 8 2018 dir1 drwxrwxrwx 1 t t 0 Mar 12 2015 dir2 drwxrwxrwx 1 t t 4096 Jan 17 2014 dir3 drwxrwxrwx 1 t t 4096 Jun 12 2017 dir4 drwxrwxrwx 1 t t ...
3
votes
2answers
1k views

Why do . and .. have a file size of 4 kB and 12 kB, respectively? [duplicate]

As displayed by ls -al, for example: drwxr-xr-x 9 jb jb 4.0K Mar 8 18:05 ./ drwx------ 49 jb jb 12K Mar 17 14:15 ../ I assume this is the minimum amount of space required to store the inode's ...
1
vote
1answer
4k views

Why the size of an empty directory in Linux is 4KB? [duplicate]

I'm using Ubuntu 14.04 and I made an empty directory on /tmp with the mkdir command: cd /tmp mkdir foo and then I checked it's size using ls: ls -ldh foo and the result shows that the size of the ...
1
vote
1answer
1k views

ls -ld /dir, Solaris [duplicate]

Always when I run ls -ld /dir the output give me the size = 512 even if there are files in it or not. but when I run du -sh the output give me the actual size of the directory including its content.
4
votes
1answer
362 views

Zip/Tar file compressed to larger size? [duplicate]

I have 4 files that I want to include them in a .zip file. drwxr-xr-x 7 skemelio themelis 4,0K Οκτ 18 00:21 CSharp drwxr-xr-x 11 skemelio themelis 4,0K Οκτ 18 00:17 gnome-games drwxr-xr-x 8 ...
1
vote
1answer
800 views

ls - why is parent directory smaller than its contents? How to see the size of directory's contents? [duplicate]

So... ls -l --block-size=MB tells me that directory is one MB ls -l --block-size=MB directory tells me there's a 3MB file inside the directory. Shouldn't that make the directory at least 3MB? ...
1
vote
1answer
277 views

(block) size of /dev, /etc, /proc, /home, explanation? [duplicate]

Can somebody explain, why a standard folder has always 4kB and some special directories have more or less? some examples: /dev 3280B, 0 Blocks, 16 Links /etc 12288B, 24 Blocks, 119 Links /proc ...
2
votes
1answer
296 views

Empty Directory Size [duplicate]

drwxrwxr-x 2 xyz xyz 176128 Jul 29 02:03 20170429 drwxrwxr-x 2 xyz xyz 110592 Jul 31 01:22 20170430 cd 20170429 ls -lart total 196 drwxrwxr-x 2 xyz xyz 176128 Jul 29 02:03 . drwxrwxr-x ...
6
votes
0answers
106 views

What's the size of a folder entry? [duplicate]

Possible Duplicate: What does size of a directory mean in output of 'ls -l' command? user@~ > ll /tmp/foo drwxr-xr-x 2 user user 4,0K 1 oct. 15:15 bar What are those 4,0K ? Is there ...
0
votes
0answers
24 views

How are the sizes of Linux directories determined? [duplicate]

The results of ls -lh provides, among other things, a listing of subdirectories and their sizes. As the directories' sizes are not determined by the sum of the files within them, how are they ...
14
votes
1answer
7k views

Why is this empty directory 3.5MB?

I've just read this question: What does size of a directory mean in output of 'ls -l' command? ...which doesn't quite answer my question. Basically, I'm moving files onto a NAS. The folders I'...
7
votes
3answers
3k views

Why size reporting for directories is different than other files?

I was wondering why an empty directory occupied 4096 bytes of space and I have seen this question. It is stated that space is allocated in blocks and hence, the size of a new directory is 4096 bytes. ...
3
votes
2answers
3k views

`ls -lS` isn't showing true size of directory

I used ls -lS command in my home directory. This command is supposed to list down the contents of a directory by size. This is what I got after running this command total 10148 -rw-rw-r-- 1 rahul ...
4
votes
1answer
759 views

size of directory reported by ls [duplicate]

I understand the size reported by ls corresponds with number of inodes inside the directory, not their actual size. I have noticed peculiar behavior, when displaying directory size with ls. Here is ...