Linux How to find the files modified in the past day.

The files modified in the past day are listed using the find command in Linux.

Run the following command:


find DIRECTORY -type f -mtime -1

The mtime parameter is the time of the file last modification, -1 is for the past 24 hours. The type f parameter is used to only test the files of the directory.

Example:

This example list all the files that have been modified in the current directory.


$ find . -type f -mtime -1
./site/source/java/interview/how-to-reverse-a-LinkedList.txt
./site/source/linux/how-to-list-files-modified-in-past-day.properties
./site/source/linux/how-to-list-files-modified-in-past-day.txt

Note: This command can be used to on the directory / to investigate all the processes running and which one has modified the configuration of the computer. Passing a different parameter can returns files that have been modified earlier, in the past week or past month for example.

References:

Find command

Recent Comments