- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find files between certain time ranges
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
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
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
07-12-2011 10:29 AM
07-12-2011 10:29 AM
Hi!
I need a way to find files between certain times within the same day.
Lets say I want to find out - between 4pm and 5pm which files got modified?
Thanks,
Allan.
Solved! Go to Solution.
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2011 10:36 AM
07-12-2011 10:36 AM
SolutionUse the find command in combination with the touch command. First touch two files with your starting and ending times (man touch). Then run find using those reference files for comparison.
find /dir -newer startfile ! -newer endfile (man find for details)
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2011 10:37 AM
07-12-2011 10:37 AM
Re: find files between certain time ranges
Hi:
This has been asked hundreds of times, but here's one way: Touch two reference files, for example:
# touch -amt 07121600.00 /tmp/ref1
# touch -amt 07121700.00 /tmp/ref2
# find . -xdev -type f -newer /tmp/ref1 -a ! -newer /tmp/ref2 -print
Of course, if you are using the GNU 'find' you have more granular arguments like '-mmin'. Then too, Perl can do this without the need for temporary files, too!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2011 10:40 AM
07-12-2011 10:40 AM
Re: find files between certain time ranges
Hi (again) Allan:
By the way, please evaluate your other posts:
http://h30499.www3.hp.com/t5/Languages-and-Scripting/Perl-or-shell-script/td-p/4819163
...JRF...