ls – How to Get Only Files Created After a Specific Date

ls

With the ls command, is it possible to show only the files created after a specific date, hour…?

I'm asking it because I have a directory with thousand of files.

I want so see all files that were created since yesterday.

I use ls -ltr but I have to wait to see all files…

There is an equivalent of DIRECTORY/SINCE=date from OpenVMS ?

Best Answer

You can use the find command to find all files that have been modified after a certain number of days.

For example, to find all files in the current directory that have been modified since yesterday (24 hours ago) use:

find . -maxdepth 1 -mtime -1

Note that to find files modified before 24 hours ago, you have to use -mtime +1 instead of -mtime -1.

Related Question