<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can I estimate the file numbers in a directory by the size of the directory? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697881#M248784</link>
    <description>We should use 'wc -w' to get the number of files.&lt;BR /&gt;&lt;BR /&gt;echo *|wc -w&lt;BR /&gt;&lt;BR /&gt;Who can tell me how much files with 12 characters filename can be in a 2212864 bytes directory? Do not use 'find, echo * or ls'.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 27 Dec 2005 07:55:16 GMT</pubDate>
    <dc:creator>MA Qiang</dc:creator>
    <dc:date>2005-12-27T07:55:16Z</dc:date>
    <item>
      <title>Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697872#M248775</link>
      <description>For example:&lt;BR /&gt;# ll -ld a05&lt;BR /&gt;drwxr-xr-x   2 4621       4620       2212864 Dec 24 08:26 a05&lt;BR /&gt;&lt;BR /&gt;Can I estimate the file numbers in a05?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Dec 2005 21:16:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697872#M248775</guid>
      <dc:creator>MA Qiang</dc:creator>
      <dc:date>2005-12-25T21:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697873#M248776</link>
      <description>I do not think so unless you query te directory inode itself. The inode of directory is same as inode of a file except that it also keeps count of what files this dir holds.</description>
      <pubDate>Sun, 25 Dec 2005 21:40:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697873#M248776</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-25T21:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697874#M248777</link>
      <description>How to query the directory inode by UNIX system command?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 25 Dec 2005 21:50:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697874#M248777</guid>
      <dc:creator>MA Qiang</dc:creator>
      <dc:date>2005-12-25T21:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697875#M248778</link>
      <description>I'm not sure your question is clear. To see the first inode number for a specific file, just add -i to the ll command as in:&lt;BR /&gt; &lt;BR /&gt;ls -ild a05&lt;BR /&gt; &lt;BR /&gt;Now in your example, the first number (2) means that this file has two names, in other words, a hard link. The next two numbers (4610 4620) are the user ID (UID) and group ID (GID) and since they are shown as numbers, there is no matching number in the /etc/passwd and /etc/group file, respectively. When you use the ls -l or ll command, the username and groupname are shown only when the UID and GID match entries in these two files.&lt;BR /&gt; &lt;BR /&gt;When these numbers show up instead, there are two possibilities:&lt;BR /&gt; &lt;BR /&gt;1. The file was restored from some other system where these numbers have meaning,&lt;BR /&gt; &lt;BR /&gt;or&lt;BR /&gt; &lt;BR /&gt;2. Your system administrator has remove a user and group with these ID numbers. Files created by this user are not automatically removed.</description>
      <pubDate>Sun, 25 Dec 2005 21:58:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697875#M248778</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-12-25T21:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697876#M248779</link>
      <description># ls -ild a05&lt;BR /&gt;641685227 drwxr-xr-x   2 4621       4620       2212864 Dec 24 08:26 a05&lt;BR /&gt;&lt;BR /&gt;What is the relationship between the inode number(641685227) and file number?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 25 Dec 2005 23:02:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697876#M248779</guid>
      <dc:creator>MA Qiang</dc:creator>
      <dc:date>2005-12-25T23:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697877#M248780</link>
      <description>MA Qiang,&lt;BR /&gt;&lt;BR /&gt;If I understood your question correctly (and I think i understood it), what you are trying to do is "you want to no. of files in a dir, just by looking at directoy.&lt;BR /&gt;&lt;BR /&gt;It is not possible unless you query the inode directly. This would require some c code. Also you need to know inode structure. This becomes more diffifcult, because, if a file in dir is removed, that inode entry is marked as free. So just because inode entry is there does not mean a file is associated with it and is present.&lt;BR /&gt;&lt;BR /&gt;man vxdb would give some insights into this.&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Dec 2005 23:12:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697877#M248780</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-12-25T23:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697878#M248781</link>
      <description>Files in Unix are stored in a structure called an inode and a directory is just another file. The number 641685227 is the number of the inode that has the directory name a05. The size of this directory is 2212864 (which is fairly large, indicating that there are a *LOT* of files in this directory. Each file name in the directory requires a space for the name, inode number and other details, but since the name can be variable in length, there is no way to determine the quantity of files in this directory by using its size.&lt;BR /&gt; &lt;BR /&gt;To count the number of files in a directory, you can use a number of techniques. Here's a simple way:&lt;BR /&gt; &lt;BR /&gt;cd a05&lt;BR /&gt;echo * | wc -l&lt;BR /&gt; &lt;BR /&gt;but if there are thousands of files, this will fail with a "line too long" message. Another way is to use find:&lt;BR /&gt; &lt;BR /&gt;cd a05&lt;BR /&gt;find a05 -type f | wc -l&lt;BR /&gt; &lt;BR /&gt;but this will also count subdirectories. To see if there are subdirectories under a05:&lt;BR /&gt; &lt;BR /&gt;cd a05&lt;BR /&gt;find a05 -type d | wc -l&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Dec 2005 07:15:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697878#M248781</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-12-26T07:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697879#M248782</link>
      <description>Hi MA Qiang,&lt;BR /&gt;A link about inode as below;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B3929-90011/ch02s04.html#s2-4-7" target="_blank"&gt;http://docs.hp.com/en/B3929-90011/ch02s04.html#s2-4-7&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Good Luck,</description>
      <pubDate>Mon, 26 Dec 2005 07:32:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697879#M248782</guid>
      <dc:creator>Cem Tugrul</dc:creator>
      <dc:date>2005-12-26T07:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697880#M248783</link>
      <description>You should be able to parse the octal dump of the &lt;BR /&gt;directory file (using command:&lt;BR /&gt; $ od -c /xyz/dir&lt;BR /&gt; '-c' option for  display in ASCII ) to get the number &lt;BR /&gt;of files present in the directory. I have not tried it yet &lt;BR /&gt;and probably would not recomend as it would be &lt;BR /&gt;messy. If you can, use Bill Hassell's suggestions.&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Dec 2005 09:56:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697880#M248783</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-12-26T09:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697881#M248784</link>
      <description>We should use 'wc -w' to get the number of files.&lt;BR /&gt;&lt;BR /&gt;echo *|wc -w&lt;BR /&gt;&lt;BR /&gt;Who can tell me how much files with 12 characters filename can be in a 2212864 bytes directory? Do not use 'find, echo * or ls'.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Dec 2005 07:55:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697881#M248784</guid>
      <dc:creator>MA Qiang</dc:creator>
      <dc:date>2005-12-27T07:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697882#M248785</link>
      <description>As mentioned above, entries enumeration can be done using some c code. See attached example. Regards. Jan.</description>
      <pubDate>Wed, 28 Dec 2005 06:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697882#M248785</guid>
      <dc:creator>Jan Zalman</dc:creator>
      <dc:date>2005-12-28T06:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697883#M248786</link>
      <description>Thanks for Jan Zalman, the code is worked. But I still want to know how to get the number of files in a directory from the size of the directory, when I have known the length of the every filenames in the directory. Is it possible?</description>
      <pubDate>Wed, 28 Dec 2005 07:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697883#M248786</guid>
      <dc:creator>MA Qiang</dc:creator>
      <dc:date>2005-12-28T07:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697884#M248787</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the inode grows when more files enter the directory but I doubt it will grow smaller when files are deleted except through recreating the directory.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Dec 2005 07:28:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697884#M248787</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2005-12-28T07:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697885#M248788</link>
      <description>I don't want to know the exact number of files, just want to know the range of the number.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 28 Dec 2005 07:40:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697885#M248788</guid>
      <dc:creator>MA Qiang</dc:creator>
      <dc:date>2005-12-28T07:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can I estimate the file numbers in a directory by the size of the directory?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697886#M248789</link>
      <description>Internal organization of directory files is fs-type dependant and thus not standartized. Size of directory file should be somehow proportional with number of files inside this directory and lenght of their names, but this is not always true.  For example (hp-ux 11.11v1 with JFS 3.3v4), directory file grows with 1kB steps (or whatever is jfs_fragment) and it does not shring back, when one deletes file inside. You can see a huge directory actually completely empty, which only means there WAS a time, it contained  thousands of files. Considering this showcase I thing credible estimation is hard to achieve.</description>
      <pubDate>Wed, 28 Dec 2005 13:29:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/can-i-estimate-the-file-numbers-in-a-directory-by-the-size-of/m-p/3697886#M248789</guid>
      <dc:creator>Jan Zalman</dc:creator>
      <dc:date>2005-12-28T13:29:15Z</dc:date>
    </item>
  </channel>
</rss>

