Open In App

How to Find Recently Modified Files in Linux?

Here we are going to see how to find recent or today’s modified files in Linux. Locating files with a particular name is one of the problems Linux user’s faces, it would be easier when you actually know the filename.

let’s assume that you have created a file in your home folder and you have forgotten the name of the file which also contains some more files and now you want to use it then below are the ways of listing all files that you created or modified today.



Method 1: Using stat command.

Stat command can be used to display timestamps of a file.



Syntax :

stat [File_Name]

Example 2: Using the ls command.

By using this command you can list only today’s files in your home folder.

Syntax :

# ls  -al --time-style=+%D | grep 'date +%D'

Where:

If you want to list the files which are sorted alphabetically.

Syntax :

# ls -alX --time-style=+%D | grep 'date +%D'

If you want to list the files based on size.

Syntax :

# ls -alS --time-style=+%D | grep 'date +%D'

Example 3: Using the find command

Syntax :

# find . -maxdepth 1 -newermt "date"

Date format yyyy-dd-mm.

Article Tags :