Linux / Unix: Find Files Modified On Specific Date

You can use the find command in Linux/Unix to search for files that were modified on a specific date. The find command supports several options to specify the time and date range for the search.

Here is an example of how to find files modified on a specific date (e.g., January 1, 2022) using the find command:

find /path/to/search -type f -newermt 2022-01-01 ! -newermt 2022-01-02

Explanation:

  • /path/to/search: This is the path to the directory you want to search. You can specify a path to a specific directory or / to search the entire file system.
  • -type f: This option specifies that you are searching for files only (not directories).
  • -newermt 2022-01-01 ! -newermt 2022-01-02: This option specifies the date range for the search. The -newermt option searches for files that have a modification time greater than (newer than) the specified date. The ! operator negates the previous condition, meaning that files modified before 2022-01-02 will be included in the search results.

The output of the find command will show the names of the files modified on January 1, 2022. You can use other options with find command to further refine your search, such as searching for files based on size, owner, and permission.

Leave a Comment