22

I have modified some files present in various folders in my webroot. This was development environment. Now I have to find all files modified yesterday to migrate to productions.

Is there any way (Linux command) to list only those files modified yesterday in my webroot tree?

Pawan
  • 517
  • 1
  • 9
  • 25
  • 11
    I thought you said you were looking for files modified yesterday? So why did you accept an answer that gives you the files modified today? – Paul Tomblin May 24 '12 at 10:52

3 Answers3

28

find ./ -mtime -1

Finds everything, what was modified in the current directory at the last 24 hours.

mega.venik
  • 648
  • 6
  • 13
26
find . -daystart -mtime 1 -print

This gets just files modified YESTERDAY - ie: today is Jun 21, only files for Jun 20 are found.

(-mtime takes a '-', a '+', or an explicit number of exact days).

If you want a long listing, substitute

-exec ls -ld \;

for the

-print.
JamieA
  • 1,984
  • 4
  • 27
  • 38
guest
  • 261
  • 3
  • 2
5
find . -mtime +2 -prune -o -mtime +1 -print

This does a find but excludes anything that was modified more than two days ago, then finds anything that was modified more than one day ago.

Paul Tomblin
  • 179,021
  • 58
  • 319
  • 408