Solved

Strange Directory being used as a file - Solaris 9

Posted on 2006-11-01
2
220 Views
Last Modified: 2013-12-27
There are a couple of directories that appear like they are being used as files:
audit = 114688 bytes
fmlogin.db = 10240 bytes

There is nothing in these directories; no files, no pipes, no directories!  If I do a "od -c audit" it is filled with binary (like "\0 \0 \0 \0 \0") just like a "normal" directory, but bigger.

But for an EMPTY directory why is the size so big?

If I do a "cp -pR audit temp0" the "contents" of audit are not copied.  ls -l temp0 = 96 bytes, just like a normal directory.

Isn't the size shown for a "ls -l" of a directory = size of inodes being used?

Many thanks, Allan

0
Comment
Question by:huffmana
[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
2 Comments
 

Author Comment

by:huffmana
ID: 17850469
I just found out what is going on!!!

The size a directory listed in "ls -ld dirname" never goes down.  Put 1000 files in a directory and the number gets big.  rm -rf all the files in that directory (so that there is nothing in the directory), and the number STAYS BIG!  The number never goes down.

Strange!  Is this normal behavior for Solaris 9?
0
 
LVL 21

Accepted Solution

by:
tfewster earned 500 total points
ID: 17853445
Yes, it's the same for all versions of Unix; A "directory" is just another type of file, containing pointers to "real" files and the names* of those files. As the number of files in the directory grows, obviously the directory file has to grow. And if files are deleted, the directory file is not shrunk, the entries are just replaced with nulls.


* Interestingly, a file doesn't really have a name of its own - The directory entry contains label (the "filename") and a pointer to an i-node.  A hard link to a file consists of another filename and pointer to the same i-node
0

Featured Post

Independent Software Vendors: 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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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

631 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