Operating System - HP-UX
1827435 Members
5223 Online
109965 Solutions
New Discussion

Why Directory size difference

 
SOLVED
Go to solution
Chakravarthi
Trusted Contributor

Why Directory size difference

Hi,

When you list the directories why there will be different size for each
example
[root@root /usr]# ls -ld man
drwxr-xr-x 14 root root 4096 Jul 25 04:02 man
[root@root /usr]# ls -ld sbin
drwxr-xr-x 2 root root 8192 Jul 25 07:31 sbin

regards
chakri
5 REPLIES 5
RAC_1
Honored Contributor

Re: Why Directory size difference

it is ok. you are listing the different directories.

first field is permissions then links then owner then group the size in bytes then timestamp.

The size of man directory is different from that of sbin

There is no substitute to HARDWORK
Pete Randall
Outstanding Contributor

Re: Why Directory size difference

Chakri,

If you do a "du -sk" on man and on sbin, you will see that sbin contains more blocks - it's bigger, that's all.

Pete

Pete
Bill Hassell
Honored Contributor
Solution

Re: Why Directory size difference

A Unix directory is itself, a file and it contains a list of inode numbers and the names associated with the inodes. When the directory is first created, it will be quite small as there are no entries. But create a few hundred files in that directory and the directory size will increase.

Now there is one 'feature' of a directory: it always grows but doesn't shrink. If you create a lot of files, then remove them, the directory will have a lot of empty slots but will not shrink in size. This is one of the reasons that a copied directory will have all it's files and subdirectories but the copied directory may be smaller than the original (empty slots are not copied).


Bill Hassell, sysadmin
Chakravarthi
Trusted Contributor

Re: Why Directory size difference

I want to know the reason,,

the size what it shows is not the total disk size, it is different

regards
chakri
Chakravarthi
Trusted Contributor

Re: Why Directory size difference

Thanks Got the required Info


regards
chakri