- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Can I estimate the file numbers in a directory by ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 01:16 PM
12-25-2005 01:16 PM
# ll -ld a05
drwxr-xr-x 2 4621 4620 2212864 Dec 24 08:26 a05
Can I estimate the file numbers in a05?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 01:40 PM
12-25-2005 01:40 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 01:50 PM
12-25-2005 01:50 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 01:58 PM
12-25-2005 01:58 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
ls -ild a05
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.
When these numbers show up instead, there are two possibilities:
1. The file was restored from some other system where these numbers have meaning,
or
2. Your system administrator has remove a user and group with these ID numbers. Files created by this user are not automatically removed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 03:02 PM
12-25-2005 03:02 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
641685227 drwxr-xr-x 2 4621 4620 2212864 Dec 24 08:26 a05
What is the relationship between the inode number(641685227) and file number?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 03:12 PM
12-25-2005 03:12 PM
SolutionIf 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.
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.
man vxdb would give some insights into this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 11:15 PM
12-25-2005 11:15 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
To count the number of files in a directory, you can use a number of techniques. Here's a simple way:
cd a05
echo * | wc -l
but if there are thousands of files, this will fail with a "line too long" message. Another way is to use find:
cd a05
find a05 -type f | wc -l
but this will also count subdirectories. To see if there are subdirectories under a05:
cd a05
find a05 -type d | wc -l
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 11:32 PM
12-25-2005 11:32 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
A link about inode as below;
http://docs.hp.com/en/B3929-90011/ch02s04.html#s2-4-7
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2005 01:56 AM
12-26-2005 01:56 AM
Re: Can I estimate the file numbers in a directory by the size of the directory?
directory file (using command:
$ od -c /xyz/dir
'-c' option for display in ASCII ) to get the number
of files present in the directory. I have not tried it yet
and probably would not recomend as it would be
messy. If you can, use Bill Hassell's suggestions.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2005 11:55 PM
12-26-2005 11:55 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
echo *|wc -w
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'.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2005 10:45 PM
12-27-2005 10:45 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2005 11:25 PM
12-27-2005 11:25 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2005 11:28 PM
12-27-2005 11:28 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
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.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2005 11:40 PM
12-27-2005 11:40 PM
Re: Can I estimate the file numbers in a directory by the size of the directory?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2005 05:29 AM
12-28-2005 05:29 AM