GNU Find Time Flashcards: -mtime, -mmin & Boundaries

Predict GNU find -mtime and -mmin results, repair time filters, and practice -daystart order and explicit timestamp boundaries with small file lists.

Σχετικά με αυτήν τη δέσμη

Practice selecting files by time with 40 short GNU find cards. Read a stated clock and file timestamps, predict membership, or repair one condition. All command examples list regular files; output order is irrelevant.

The cards move from timestamp choice and elapsed-day ranges into interleaved minute tests and repairs, then UTC calendar references and explicit timestamp comparisons. They practice command → selected files, task → corrected condition, and selected mistaken claims → repaired explanation. Closely related variants are separated. Exhaustive reverse flag definitions and every equivalent command are excluded: they add ambiguous answers rather than one clear selection decision. Unsigned minute tests are checked against GNU findutils 4.11.0 rather than inferred from day tests.

The scope is GNU find: -mtime, -mmin, a small -amin contrast, -daystart placement, -newermt and -newer. Elapsed examples state the initialization clock and avoid exact age cutoffs. Exact endpoint practice uses explicit timestamps: -newermt LOWER ! -newermt UPPER selects (LOWER, UPPER]. The deck excludes BSD/macOS portability, future timestamps, exact elapsed/daystart cutoff drills, exhaustive date parsing or DST, creation-time filters, deletion, traversal, and shell handoff; those need separate practice.

Original questions, examples, explanations and ordering were authored with AI assistance and checked against the GNU time reference, age-range reference, timestamp-comparison reference and the GNU findutils 4.11.0 release source. The cover is an original AI-generated illustration. CC0 1.0 covers the original deck text, organization, metadata and cover to the extent applicable rights exist; factual behavior is not owned, and GNU documentation and source retain their own licenses. No GNU manual prose, source code or competitor card text is included in the deck.

An independent, unofficial learning resource with no affiliation with or endorsement by GNU or the Free Software Foundation.

Κάρτες σε αυτήν τη δέσμη

  1. Κάρτα 1

    Ερώτηση

    GNU find: which stored timestamp does -mtime test?

    Απάντηση

    The last content-modification time (mtime). It does not mean file creation time.

  2. Κάρτα 2

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: fir 7h20m, elm 23h40m, oak 24h20m. Which match -mtime 0?

    Απάντηση

    fir and elm. Their ages are inside the first 24-hour range; oak has crossed it. Compare membership, not output order.

  3. Κάρτα 3

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: red 12m30s, blue 44m30s, green 45m30s. Which match -mmin -45?

    Απάντηση

    red and blue. -mmin -45 selects timestamps newer than the 45-minute cutoff in this fixture.

  4. Κάρτα 4

    Ερώτηση

    GNU find: what does the c in -ctime refer to?

    Απάντηση

    Status-change time. Changes to file data or attributes can update ctime; the c does not stand for creation.

  5. Κάρτα 5

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: ash 20h, pine 28h, yew 46h, birch 53h. Which match -mtime 1?

    Απάντηση

    pine and yew. The unsigned day test selects the one-day range, between 24 and 48 hours here; it does not select every file older than 24 hours.

  6. Κάρτα 6

    Ερώτηση

    GNU find; regular file note has stored atime 2026-10-23 17:40 UTC and mtime 2026-10-20 17:40 UTC. At 2026-10-23 18:00 UTC, which tests its recent access: -amin -60 or -mmin -60?

    Απάντηση

    -amin -60. It tests the supplied access timestamp. -mmin uses the much older modification timestamp. These are stored timestamps, not a claim that every read updates atime.

  7. Κάρτα 7

    Ερώτηση

    GNU find, no -daystart; regular files all have past mtimes. Change only the time test in find ./lab -type f -mtime -90 -print to select modifications within the last 90 minutes.

    Απάντηση

    Use -mmin -90.

    find ./lab -type f -mmin -90 -print
    

    -mtime measures days; -mmin measures minutes. This is an elapsed window, not a calendar day.

  8. Κάρτα 8

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: tin 22h, copper 26h, zinc 51h. Which match -mtime +0?

    Απάντηση

    copper and zinc. With these off-boundary ages, +0 selects beyond the first 24-hour range. tin is too recent.

  9. Κάρτα 9

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. note is stamped 2026-10-22 09:00:00. Does it match -newermt '2026-10-22 09:00:00 UTC'?

    Απάντηση

    No. Newer-than is strict: an identical timestamp fails -newermt.

  10. Κάρτα 10

    Ερώτηση

    GNU find: complete find ./lab ___ -mtime -1 -print to limit results to regular files.

    Απάντηση

    -type f.

    find ./lab -type f -mtime -1 -print
    

    The type test excludes directories; -print lists matching paths.

  11. Κάρτα 11

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: dawn 44m30s, noon 45m30s. Which match unsigned -mmin 45 in GNU findutils 4.11.0?

    Απάντηση

    dawn only. In 4.11.0, unsigned -mmin 45 selects timestamps within the minute immediately newer than the 45-minute cutoff. Do not copy the unsigned -mtime day-range numbering into minute tests.

  12. Κάρτα 12

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: clay 46h, slate 49h, chalk 73h. Which match -mtime +1?

    Απάντηση

    slate and chalk. +1 goes beyond the one-day range, so 46 hours is too recent. These ages stay away from the exact 48-hour cutoff.

  13. Κάρτα 13

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: a 17h, b 47h, c 50h. Which match -mtime -2?

    Απάντηση

    a and b. Both are under two 24-hour periods in this fixture; c is beyond that range.

  14. Κάρτα 14

    Ερώτηση

    GNU find: choose -mtime or -ctime to filter by when file contents were last modified.

    Απάντηση

    -mtime. -ctime tracks status changes too, so it is not a substitute when the task specifically asks for content-modification time.

  15. Κάρτα 15

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. a is 2026-10-22 07:00, b 09:00, c 11:00, d 13:00. Which match -newermt '2026-10-22 08:00:00 UTC' ! -newermt '2026-10-22 12:00:00 UTC'?

    Απάντηση

    b and c. Both are after 08:00 and no later than 12:00 on October 22. The two adjacent conditions must both succeed.

  16. Κάρτα 16

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: iris 44m30s, rose 45m30s. Which match -mmin +45?

    Απάντηση

    rose only. +45 tests for a timestamp older than the 45-minute cutoff here. It does not wait for a 46-minute age.

  17. Κάρτα 17

    Ερώτηση

    GNU find, no -daystart; regular files have past mtimes, none within a minute of a 24-hour boundary. Change only 2 in -mtime 2 to select every file younger than two days.

    Απάντηση

    Use -mtime -2. The minus sign selects the younger range; unsigned 2 selects the two-day range instead.

  18. Κάρτα 18

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. a is 2026-10-22 22:00, b 2026-10-23 02:00, c 2026-10-21 22:00. At 2026-10-23 18:00 UTC, which match TZ=UTC find ./lab -daystart -type f -mtime 1 -print?

    Απάντηση

    a only. Placing -daystart before -mtime makes this a UTC midnight-based day test. The supplied times avoid midnight endpoints.

  19. Κάρτα 19

    Ερώτηση

    GNU find: which test takes the literal instant '2026-10-22 12:00:00 UTC': -newer or -newermt?

    Απάντηση

    -newermt. Its t means the reference argument is a parsed time. -newer expects a reference file path.

  20. Κάρτα 20

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: mint 47h, sage 58h, thyme 71h, basil 74h. Which match -mtime 2?

    Απάντηση

    sage and thyme. Their ages fall inside the two-day range, between 48 and 72 hours here. mint is too young; basil is too old.

  21. Κάρτα 21

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. log is stamped 2026-10-22 15:00:00. Does it match ! -newermt '2026-10-22 15:00:00 UTC'?

    Απάντηση

    Yes. Equality fails the newer-than test, and ! reverses that result. The negated test includes the bound.

  22. Κάρτα 22

    Ερώτηση

    GNU find, no -daystart; regular files are aged 23h, 25h and 49h at 2026-10-23 18:00 UTC. Change only +1 in -mtime +1 to select the 25h and 49h files.

    Απάντηση

    Use -mtime +0. +1 omits the 25-hour file; +0 includes both stated older files. All three ages are well away from the cutoff.

  23. Κάρτα 23

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: a 14m30s, b 16m30s, c 39m30s, d 40m30s. Which match -mmin +15 -mmin -40?

    Απάντηση

    b and c. They are older than 15 minutes and younger than 40 minutes. Adjacent tests are combined with AND.

  24. Κάρτα 24

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. a is 2026-10-22 22:00, b 2026-10-22 10:00. At 2026-10-23 18:00 UTC, which match TZ=UTC find ./lab -type f -mtime 1 -daystart -print?

    Απάντηση

    b only. -daystart comes too late to affect the earlier -mtime test. The ages are 20 hours and 32 hours; only b is in the elapsed one-day range.

  25. Κάρτα 25

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: a 12h, b 30h, c 60h, d 80h. Which match -mtime +0 -mtime -3?

    Απάντηση

    b and c. Both pass the older-than-first-range condition and the younger-than-three-days condition. The result is their intersection.

  26. Κάρτα 26

    Ερώτηση

    GNU find: can -ctime 0 establish that a file was created within the last day?

    Απάντηση

    No. It tests recent status change, which can happen to an old file. Creation or birth time is a separate timestamp and is outside this deck's filters.

  27. Κάρτα 27

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. edge is stamped 2026-10-22 06:00:00. Is it selected by -newermt '2026-10-22 06:00:00 UTC' ! -newermt '2026-10-22 10:00:00 UTC'?

    Απάντηση

    No. edge equals the lower bound and fails the first, strict newer-than test. The interval excludes its lower endpoint.

  28. Κάρτα 28

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: note 90m. Does it match -mtime 1?

    Απάντηση

    No. Ninety minutes is still in the first 24-hour range. The number 1 in -mtime 1 does not mean one hour.

  29. Κάρτα 29

    Ερώτηση

    GNU find, no -daystart; regular files have past mtimes, none near a 24-hour boundary. Change only +3 in -mtime +3 to select files younger than three days.

    Απάντηση

    Use -mtime -3. The minus sign selects the younger range. +3 instead selects beyond the three-day range.

  30. Κάρτα 30

    Ερώτηση

    GNU find: does prefixing a command with TZ=UTC freeze its current time at a particular UTC instant?

    Απάντηση

    No. TZ=UTC chooses the timezone for calendar interpretation. The clock still advances, so an elapsed-age exercise must state its initialization time separately.

  31. Κάρτα 31

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. edge is stamped 2026-10-22 10:00:00. Is it selected by -newermt '2026-10-22 06:00:00 UTC' ! -newermt '2026-10-22 10:00:00 UTC'?

    Απάντηση

    Yes. edge is after the lower bound and equal to the upper bound. Negating the upper newer-than test includes that equality.

  32. Κάρτα 32

    Ερώτηση

    GNU find; regular reference file ./ref has mtime 2026-10-22 12:00:00 UTC and lies outside ./lab. Regular files in ./lab have mtimes a 11:59:00, b 12:00:00, c 12:01:00 that day. Which match -newer ./ref?

    Απάντηση

    c only. -newer compares each candidate's mtime with the reference file's mtime. Equality fails.

  33. Κάρτα 33

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: old 5d20m, recent 4d20m. Which match -mtime +4?

    Απάντηση

    old only. +4 goes beyond the four-day range, so the transition is near five days, not four. Both examples avoid the exact cutoff.

  34. Κάρτα 34

    Ερώτηση

    GNU find, no -daystart; starts 2026-10-23 18:00 UTC. Regular files have these mtime ages: report 90m. Which selects it: -mmin -60 or -mtime -1?

    Απάντηση

    -mtime -1 only. Ninety minutes exceeds the 60-minute window but is well within the first 24-hour range.

  35. Κάρτα 35

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. a is 2026-10-22 23:00, b 2026-10-23 03:00, c 2026-10-23 17:00. At 2026-10-23 18:00 UTC, which match TZ=UTC find ./lab -daystart -type f -mtime 0 -print?

    Απάντηση

    b and c. With -daystart before the test, these past timestamps fall in the current UTC day range. a is in the previous day. No fixture file is stamped at midnight.

  36. Κάρτα 36

    Ερώτηση

    GNU find; regular files have fixed mtimes in UTC. a is 2026-10-22 05:59:59, b 06:00:00, c 08:00:00, d 10:00:00, e 10:00:01. Which match -newermt '2026-10-22 06:00:00 UTC' ! -newermt '2026-10-22 10:00:00 UTC'?

    Απάντηση

    c and d. The window is (06:00, 10:00] on October 22: after the lower instant, through the upper instant inclusive.

  37. Κάρτα 37

    Ερώτηση

    GNU find; regular files have fixed mtimes. Change only the test name in find ./lab -type f -newer '2026-10-22 12:00:00 UTC' -print to compare against that literal instant.

    Απάντηση

    Use -newermt.

    find ./lab -type f -newermt '2026-10-22 12:00:00 UTC' -print
    

    -newer would interpret the argument as a file path.

  38. Κάρτα 38

    Ερώτηση

    GNU find, no -daystart; regular files have past mtimes, each at least a minute from a 24-hour boundary. Do -mtime 0 and -mtime -1 select the same set?

    Απάντηση

    Yes, under these assumptions. Both select the supplied files inside the first 24-hour range. This is not a rule for future timestamps or exact cutoff instants.

  39. Κάρτα 39

    Ερώτηση

    GNU find, TZ=UTC; regular file journal has mtime 2026-10-22 23:00 UTC. At 2026-10-23 18:00 UTC, does plain -mtime 1 select this file from yesterday?

    Απάντηση

    No. It is only 19 hours old. Yesterday's calendar date and the elapsed one-day range are different targets. -daystart before the test changes the reference.

  40. Κάρτα 40

    Ερώτηση

    GNU find uses -newermt '2026-10-22 06:00:00 UTC' ! -newermt '2026-10-22 10:00:00 UTC' on regular files. Repair the claim “includes 06:00, excludes 10:00” for those UTC instants.

    Απάντηση

    Excludes 06:00; includes 10:00. The actual window is (lower, upper], not [lower, upper). Naming calendar boundaries does not reverse the comparisons.

Three file folders beside a blank clock-like disc, with a teal window highlighting two folders.

40 κάρτες

GNU Find Time Flashcards: -mtime, -mmin & Boundaries

Μελετήστε αυτήν τη δέσμη δωρεάν

Το Nibomo ανοίγει για να ξεκινήσετε τη μελέτη.