FileHound
    Preparing search index...

    Function modified

    • Matches files by when they were last modified, using an expression of their age: an optional operator, a whole number and an optional unit, such as '<2 days', '>8h' or '>=1 week'.

      The operators are <, <=, >, >= and == (or =), which is the default. The units are minutes (m, min, mins, minute, minutes), hours (h, hour, hours), days (d, day, days, the default) and weeks (w, week, weeks), in any case.

      Parameters

      • expression: string

        the age expression

      Returns FilePredicate

      the predicate

      Ages are compared in whole units, like find -mtime: a file modified two and a half days ago is 2 days old, so it matches '=2 days', '>=2 days' and '<3 days', but not '>2 days'. Days and weeks are calendar days, so stay correct across daylight saving changes. Ages are measured when each file is tested.

      TypeError Thrown if the expression is not a string.

      ExpressionError Thrown if the expression can't be parsed or has an unknown unit.

      FileHound.create().match(modified('<2 days'));