Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Size of a directory ?

Posted on 1998-07-29
1
Medium Priority
?
232 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 150 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

824 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