Solved

Size of a directory ?

Posted on 1998-07-29
1
220 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ipconfig not working on windows 10 bash shell; what other commands are missing. 17 169
Why isn't object file created? 6 58
installing docker on ubuntu 6 29
awk sed 8 42
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

770 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