Como posso exibir arquivos que foram gravados em uma data específica

4

Eu tenho uma pasta composta de arquivos e subpastas (de arquivos). Eu gostaria de exibir todos os arquivos *.pth.tar escritos entre 23 e 28 de fevereiro de 2018. Isso é possível?

Qual é o comando que preciso fazer?

Obrigado

    
por eric lardon 29.03.2018 / 14:17

1 resposta

6

Você encontra arquivos modificados entre um intervalo de datas usando o comando find do -newermt , por exemplo,

find path/to/folder/ -name '*.pth.tar' -newermt '23 Feb 2018' ! -newermt '01 Mar 2018'

O ! é um operador de negação lógica. De 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
    
por steeldriver 29.03.2018 / 14:38