Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • At least with recent versions of GNU find, you can skip the temp file and use time strings directly with the -newerXY test e.g. find . -type f -newermt yesterday Commented Oct 8, 2017 at 14:19
  • @steeldriver Ah, but yesterday would refer to "this time yesterday" which may cause files modified before midnight to be returned. Commented Oct 8, 2017 at 14:23
  • @steeldriver 0 works though... Commented Oct 8, 2017 at 14:29
  • getting error: $ touch -d "$(date +%FT00:00:00)" /tmp/midnight touch: illegal option -- d usage: touch [-amc] [-t [[CC]YY]MMDDhhmm[.SS] | -r ref_file] file ... Commented Oct 8, 2017 at 14:50
  • 1
    @User123 What Linux are you running? Are you using busybox? The -d flag is a POSIX standard flag. Oh well, change that line to touch -t "$(date +%Y%m%d0000)" /tmp/midnight. Commented Oct 8, 2017 at 14:55