Unix – find files modified on a specific date / between two dates

find” command is our friend here, using “-newer” argument.

This is a 2-step process:

  1. create reference file(s) with required date limit(s)
  2. run find command with reference to this/these file(s)

find all files modified after 2015/12/15 6:51pm and 2 seconds

touch -t 201512151851.02 /tmp/t
find . -newer /tmp/t

find all files modified between two dates

touch -t <date1> /tmp/t1
touch -t <date2> /tmp/t2
find . -newer /tmp/t1 -and -not -newer /tmp/t2

sources

Post a Comment

Your email is never published nor shared. You're allow to say what you want...