Multiple choice technology operating systems

How will you find the files that are accessed/edited before a day?

  1. find -mtime -24

  2. find -mday -1

  3. find -mday +1

  4. find -mtime -1

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The find -mtime -1 command finds files modified less than 1 day ago (within the last 24 hours). The -mtime option uses days, where negative values mean less than and positive values mean more than. Option A is incorrect because -mtime uses days not hours. Option B uses the non-existent -mday option. Option C with +1 would find files modified MORE than 1 day ago.

AI explanation

The Unix/Linux find command's -mtime option filters files by modification time measured in 24-hour units before the current time; -mtime -1 means 'modified less than 1 day ago,' i.e., within the last 24 hours — matching 'files accessed/edited before a day' (interpreted as within the past day). The other options use a non-existent flag -mday, which isn't valid find syntax at all, so they can't work regardless of the sign used. Only -mtime -1 uses find's real, correct option name with the correct comparison sign for 'within the last day.'