Finding a File by Its Date

In some cases, you may not be able to recall what a file is named or what its extension is, but you may know what day you created it. Creation date is another searchable criterion that you can select. To search, you will need to adapt a “how many days ago” mentality because Unix will search for files that have been made since the time that you specify. Let's look at an example:

1.
Determine how many days ago your file was made.
2.
Choose a starting directory for the search.
3.
Use the find command with the -ctime option: find <starting directory> -ctime <how many days old> -print.

For example:

>find ~/ -ctime 5 -print

This command specifies that Unix should find a file in your home directory that is less than five ...

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.