- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to Calculate number of files under filesys...
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
Discussions
Discussions
Discussions
Forums
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
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
тАО05-08-2005 05:28 PM
тАО05-08-2005 05:28 PM
How to Calculate number of files under filesystem
can anybody tell how to calculate the total number of files under a filesystem .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 05:38 PM
тАО05-08-2005 05:38 PM
Re: How to Calculate number of files under filesystem
will give you total numeber of files on device /usr.
Sudeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 06:05 PM
тАО05-08-2005 06:05 PM
Re: How to Calculate number of files under filesystem
this will not do . du -x will give you the size not the number of files . please go through man page of du .
ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 06:09 PM
тАО05-08-2005 06:09 PM
Re: How to Calculate number of files under filesystem
ll |wc -l
the number of files is one less than the returned value
cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 06:11 PM
тАО05-08-2005 06:11 PM
Re: How to Calculate number of files under filesystem
Sudeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 06:13 PM
тАО05-08-2005 06:13 PM
Re: How to Calculate number of files under filesystem
[rx260-11]/ >du -x /usr | wc -l
1388
[rx260-11]/ >
Sudeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 06:25 PM
тАО05-08-2005 06:25 PM
Re: How to Calculate number of files under filesystem
find . | wc -l
Just lists all the files under all directories and then counts the output.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 06:37 PM
тАО05-08-2005 06:37 PM
Re: How to Calculate number of files under filesystem
find . -xdev -type f | wc -l
This will give a count off all files on the local filesystem.
Cheerio,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2005 10:36 PM
тАО05-08-2005 10:36 PM
Re: How to Calculate number of files under filesystem
find
Get the file system patch with bdf command.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 12:30 AM
тАО05-10-2005 12:30 AM
Re: How to Calculate number of files under filesystem
Directories are files too. That is unless you don't feel like counting them. Otherwise this would work.
Let's break it down.
find . <--means find everything in this directory and below. So you would want to be at the top of the filesystem.
"-print" outputs what the find command finds.
wc -l <--this counts the lines from what goes into it. The find command spits out one file per line. So by counting the lines, you are counting the files.
"-xdev" ? I never heard of this. It's not in the man page for the find I have. But I'm using hpux11.0. Perhaps that's in BSD, Linux, AIX, or HPUX11i.
One last gocha....
You have two filesystems.
/disk1 and /disk1/a/b.
The filesystem mounted to /disk1/a/b is a filesystem of it's own. Should it be counted in the total of files for /disk1? No I don't think so. It is its own filesystem. So the total files on /disk1 are the total files found on /disk1 minus the total files found in /disk1/a/b. Do you have this case? Everybody has this case.
/opt is mounted to the / filesystem.
/var is too.
hey...just about everything is.
So how many files are in in root (/)?
Run bdf to see what filesystems are mounted to the system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 12:54 AM
тАО05-10-2005 12:54 AM
Re: How to Calculate number of files under filesystem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 12:55 AM
тАО05-10-2005 12:55 AM
Re: How to Calculate number of files under filesystem
what is it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:00 AM
тАО05-10-2005 01:00 AM
Re: How to Calculate number of files under filesystem
I just had to run the man on a more recent hpux box.
It tells find to avoid crossing into filesystem mount points. That's what I was just talking about. So that means you CAN run "find / -xdev -print | wc -l" to get just the files under the ROOT filesystem.
NICE!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:00 AM
тАО05-10-2005 01:00 AM
Re: How to Calculate number of files under filesystem
-xdev A position-independent term that causes find
to avoid crossing any file system mount
points that exist below starting points
enumerated in pathname_list. The mount point
itself is visited, but entries below the
mount point are not. Always true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:02 AM
тАО05-10-2005 01:02 AM
Re: How to Calculate number of files under filesystem
Sorry I was so short (in text).
Steve Post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:02 AM
тАО05-10-2005 01:02 AM
Re: How to Calculate number of files under filesystem
A "fast" method is du -i (see man pages for du). It actually reports number of used inodes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:05 AM
тАО05-10-2005 01:05 AM
Re: How to Calculate number of files under filesystem
you could just execute
# bdf -i
with or without a mount point as argument. The number of files under a filesystem should be equivalent to the number of i-nodes used (iused).
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:05 AM
тАО05-10-2005 01:05 AM
Re: How to Calculate number of files under filesystem
from 'man find' (btw. from 11.0):
-xdev
A position-independent term that causes find
to avoid crossing any file system mount
points that exist below starting points
enumerated in pathname_list. The mount point
itself is visited, but entries below the
mount point are not. Always true.
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:07 AM
тАО05-10-2005 01:07 AM
Re: How to Calculate number of files under filesystem
Alex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 01:17 AM
тАО05-10-2005 01:17 AM
Re: How to Calculate number of files under filesystem
Sorry, my previous reply was wrong. It should (of course) be "df -i" not "du -i".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 06:56 AM
тАО05-10-2005 06:56 AM
Re: How to Calculate number of files under filesystem
# find