Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux all files of folder modified yesterday [closed]

Tags:

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?

like image 464
Pawan Avatar asked May 24 '12 02:05

Pawan


People also ask

Where is Yesterday file in Unix?

You can use the find command to find all files that have been modified after a certain number of days. Note that to find files modified before 24 hours ago, you have to use -mtime +1 instead of -mtime -1 .

How do I see recently changed files in Linux?

Finding last day modified files in Linux:The find command is used to search files. The newermt command compares files timestamp with the argument passed, in this case “1 day ago”. Then, the ls command is passed to list the files. To find last day modified files, you can also use the mtime command together with find.

Where is the list of files modified in the last 30 days Linux?

Use -mtime option with the find command to search files based on modification time followed by the number of days. Number of days can be used in two formats.


2 Answers

find ./ -mtime -1

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

like image 192
mega.venik Avatar answered Sep 20 '22 14:09

mega.venik


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. 
like image 26
guest Avatar answered Sep 17 '22 14:09

guest