You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time
Now find . ! -newermt 'jan 01, 2000' -exec touch -d@1706517278 {} + works, and -newerat and -newerct is also available. -newerBt is available, but depends on whether the file system supports birthed time / created time.
Use the following command to better observe the results.
In order to parse this time string, I added a function parse_date_str_to_timestamps() that converts from string to timestamp, then created the corresponding Matcher and compared it with the timestamp of the target file to get the result. I will add relevant test code later.
Activity
hanbings commentedon Mar 27, 2024
hi, this issue looks like there hasn't been an update here for a long time, can I give it a try?
cakebaker commentedon Mar 27, 2024
@hanbings sure, go ahead :)
hanbings commentedon Mar 27, 2024
Thanks.
Now
find . ! -newermt 'jan 01, 2000' -exec touch -d@1706517278 {} +works, and-neweratand-newerctis also available.-newerBtis available, but depends on whether the file system supportsbirthed time / created time.Use the following command to better observe the results.
In order to parse this time string, I added a function
parse_date_str_to_timestamps()that converts from string to timestamp, then created the correspondingMatcherand compared it with the timestamp of the target file to get the result. I will add relevant test code later.Please forgive my code for not looking very good.