How to find files modified in Linux
I am learning Linux commands and I want to know how to find files in a directory which has been modified on some specific dates.
Suppose that I have a directory which is full of files. I want a small step how to get all files that are newer than other files. Is there a way to know this and that too with the command?
Re: How to find files modified in Linux
To find all files that was modified since a specific time ago in Linux, use the find command.
Syntax: find / -mtime number_of_days -print
For Example:
find / -mtime -3 -print
displays the files modified within 3 days
Re: How to find files modified in Linux
The Linux command is quite powerful and helps to see a list of all recently modified files. For example, if you want to see the files modified in last one week:
find . -mtime -7
However if you still want to be specific in this search then:
find . -ctime +3 -a -ctime -7
which shows all the files modified with particular time from 3rd day till yesterday.