如何显示在特定日期写入的文件

eri*_*don 4 command-line files directory

l 有一个由文件和子文件夹(文件)组成的文件夹。我想显示*.pth.tar2018 年 2 月 23 日至 28 日之间写入的所有文件 。这可能吗?

我需要什么命令才能做到这一点?

谢谢

ste*_*ver 6

您可以使用命令的测试找到在一系列日期之间修改的文件,例如find-newermt

find path/to/folder/ -name '*.pth.tar' -newermt '23 Feb 2018' ! -newermt '01 Mar 2018'
Run Code Online (Sandbox Code Playgroud)

!是一个逻辑否定运算符。来自man find

   -newerXY reference
          Succeeds  if  timestamp  X of the file being considered is newer
          than timestamp Y of the file reference.   The letters  X  and  Y
          can be any of the following letters:

          a   The access time of the file reference
          B   The birth time of the file reference
          c   The inode status change time of reference
          m   The modification time of the file reference
          t   reference is interpreted directly as a time
Run Code Online (Sandbox Code Playgroud)