Solved

Size of a directory ?

Posted on 1998-07-29
1
222 Views
Last Modified: 2010-04-20
Hi ,
    I have seen that when we do an ls in a directory containing subdirectories we find that the size of a directory is 512 bytes irrespective of the directory being empty or not. But in the linux system that I have installed in my system each directory shows to occupr 32kb space. I have installed linux on a primary Dos partition i.e mine is a UMSDos kind of installation. Can anybody help me solve this ?
Thanks
Harsha
0
Comment
Question by:harsha_n_s
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
mlev earned 50 total points
ID: 1637666
The size of a directory as shown in ls -l is the total size of blocks it occupies on the disk, thus the minimum size is the size of a single block. It depends on the filesystem you use. Some Unix installations use filesystems with block size of 512, that's what you probably saw (but that doesn't mean the size is ALWAYS 512; if you put more files in the directory, it will grow to 1024, then to 1536 etc.) Linux standard filesystem is ext2fs and it uses a default block size of 1024. Your filesystem is UMSDOS, built on top of FAT, and it uses the underlying FAT block size. Apparently, in your case it's 32K.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unix process listing into CSV format 3 53
rDNS on single IP and multiple domains 11 51
list of sudo access for date range 5 35
Can't connect to FTP 18 110
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question