- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Does "find" support filtering files by absolute, n...
Operating System - Linux
1753878
Members
7129
Online
108809
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО02-26-2009 03:14 AM
тАО02-26-2009 03:14 AM
Find has many options for filtering files based on "relative" timestamp - i.e., modified 5 days ago.
But is there some option/trick for filtering files modified Feb, 22, for example?
(yes, I know, there are millions ways to do this with another utilities/scripts, but I'm very curious about find ...)
But is there some option/trick for filtering files modified Feb, 22, for example?
(yes, I know, there are millions ways to do this with another utilities/scripts, but I'm very curious about find ...)
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 04:59 AM
тАО02-26-2009 04:59 AM
Solution
The portable way would be use the "touch" command with date/time options to create the necessary reference file, and then use find's -newer option with the reference file.
However, Linux has GNU find, which offers more options than POSIX standards requre.
To find files modified on Feb 22, you should think of it as "newer than Feb 22 00:00:00 but not newer than Feb 23 00:00:00".
The command line example for (a recent enough version of) GNU find:
find -newermt 2009-02-22 \! -newermt 2009-02-23
The date/time format may depend on your locale: as the man page says, if "date -d" accepts time specified in a certain format, find will understand it too.
MK
However, Linux has GNU find, which offers more options than POSIX standards requre.
To find files modified on Feb 22, you should think of it as "newer than Feb 22 00:00:00 but not newer than Feb 23 00:00:00".
The command line example for (a recent enough version of) GNU find:
find
The date/time format may depend on your locale: as the man page says, if "date -d" accepts time specified in a certain format, find will understand it too.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 06:00 AM
тАО02-26-2009 06:00 AM
Re: Does "find" support filtering files by absolute, not relative date/time
cool!
I wasn't aware about "newermt" and similar options because my RHEL5's find (4.2.27) doesn't have them.
Trick with two "reference" files is very interesting too.
Thanks a lot!
Vitaly
I wasn't aware about "newermt" and similar options because my RHEL5's find (4.2.27) doesn't have them.
Trick with two "reference" files is very interesting too.
Thanks a lot!
Vitaly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2009 02:20 AM
тАО03-02-2009 02:20 AM
Re: Does "find" support filtering files by absolute, not relative date/time
thanks!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP