- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: count files created
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
05-29-2005 04:27 PM
05-29-2005 04:27 PM
count files created
I have a files created everyday. And i would like to have a trend how many files are created each day.
I would like to ask for counting files everyday including the files created yesterday or a month ago?
Is this possible?
Maximum points for all correct replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2005 05:29 PM
05-29-2005 05:29 PM
Re: count files created
What about
"find / -name *.* -print -ctime...."
Use ctime ->created time
atime -> accesed time
mtime -> modified time
with appropriate time value
Pipe to a "wc -l" to get the count.
Refer to manpage of find.
Just a thought.
Regds
TT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2005 05:40 PM
05-29-2005 05:40 PM
Re: count files created
To find the file count in a directory you can do this.
ls -l | wc -l. This will give the number of file count in the directory.
If you want the number of file for a particular period, then do this.
For example the file names have log as a common string.
find . -name "*log*" -mtime +3 -exec ls -l {} \; | wc -l
This will give the count for files called as *log* with modified date as 3 days back.
Indira A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2005 06:00 PM
05-29-2005 06:00 PM
Re: count files created
I see a problem in using find command here, any option like -mtime, -atime or -ctime would give the output as n-1 to n multiples of 24 hrs, where 'n' is the nubner specified after say -ctime.
Thus giving -ctime 1 would give all the files created since current time previous day.
What Fernando needs is only files created today. We would need to write a script which checks the file create date with current date kind of logic.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2005 07:55 PM
05-29-2005 07:55 PM
Re: count files created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2005 08:43 PM
05-29-2005 08:43 PM
Re: count files created
unfortunately, unix does not register any data concerning file creation time: you only have the last time the content of the file was modified, the last time the file itself was accessed, and the last time the inode info of the file was modified.
The last time the inode info was modified is probably your best chance, as it may coincide with the creation time of the file. However, if anyone has changed access rights, user/group relationships etc. after file creation time - and you cannot tell if that is the case - it will of course not work.
regards,
John K.