LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-30-2013, 06:42 AM   #1
jknath
LQ Newbie
 
Registered: Oct 2013
Posts: 7

Rep: Reputation: Disabled
4096


Hi, Im posting this question post verifying all similar question related to this.

"Why is the size of a directory always 4096 bytes in unix?"

Can u tell me the layman example? Im a beginner. So plz explain me easily understandable.

Thanks
 
Old 10-30-2013, 07:02 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Whenever a directory is created it takes 1 block for storing some system related info (meta-data about files, including the file names contained in that directory).

This doesn't always amount to 4k (4096), it depends on the block-size, which is 4096 on most modern Linux machines.

If 1 block isn't enough to store the data, it adds another block (and another and ...). The directory size is always a multiple of the block-size.

You can get the block-size that is used with the dumpe2fs command:
Code:
dumpe2fs /device | grep "^Block size:"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why the 'N_TTY_BUF_SIZE' is restricted as 4096? d2e2004 Linux - Newbie 2 12-10-2007 03:36 AM
Why the 'N_TTY_BUF_SIZE' is restricted as 4096? d2e2004 Linux - Hardware 2 12-08-2007 03:38 AM
4096 Limit RonGG Linux - Software 1 08-02-2007 02:19 PM
Directories always 4096 bytes? riwaJR Debian 4 04-03-2006 01:16 PM
ls -la 4096 mikeshn Linux - General 4 08-31-2003 08:27 PM


All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration