LINUX.ORG.RU

Как узнать какие файлы в каталоге изменились в последнюю минуту?


0

1

Какую команду надо ввести в консоли, чтобы узнать какие файлы в указанном каталоге и его подкаталогах изменились или добавились в последнюю минуту (или две, или три минуты, ну вы поняли).

man find

       -amin n
              File was last accessed n minutes ago.

       -anewer file
              File was last accessed more recently than file was modified.  If
              file is a symbolic link and the -H option or the -L option is in
              effect, the access time of the file it points to is always used.

       -atime n
              File was last accessed n*24 hours ago.  When  find  figures  out
              how  many  24-hour  periods  ago the file was last accessed, any
              fractional part is ignored, so to match -atime +1, a file has to
              have been accessed at least two days ago.

       -cmin n
              File's status was last changed n minutes ago.

       -cnewer file
              File's status was last changed more recently than file was modi‐
              fied.  If file is a symbolic link and the -H option  or  the  -L
              option  is  in  effect,  the  status-change  time of the file it
              points to is always used.

       -ctime n
              File's status was last changed n*24 hours ago.  See the comments
              for -atime to understand how rounding affects the interpretation
              of file status change times.

       -mmin n
              File's data was last modified n minutes ago.

       -mtime n
              File's data was last modified n*24 hours ago.  See the  comments
              for -atime to understand how rounding affects the interpretation
              of file modification times.
       -newer file
              File  was  modified  more recently than file.  If file is a sym‐
              bolic link and the -H option or the -L option is in effect,  the
              modification time of the file it points to is always used.

       -newerXY reference
              Compares  the timestamp of the current file with reference.  The
              reference argument is normally the name of a file  (and  one  of
              its  timestamps is used for the comparison) but it may also be a
              string describing an absolute time.  X and  Y  are  placeholders
              for other letters, and these letters select which time belonging
              to how reference is used for the comparison.

              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

              Some combinations are invalid; for example, it is invalid for  X
              to  be t.  Some combinations are not implemented on all systems;
              for example B is not supported on all systems.  If an invalid or
              unsupported  combination  of  XY  is  specified,  a  fatal error
              results.  Time specifications are interpreted as for  the  argu‐
              ment  to the -d option of GNU date.  If you try to use the birth
              time of a reference file, and the birth time  cannot  be  deter‐
              mined,  a  fatal  error  message results.  If you specify a test
              which refers to the birth time of  files  being  examined,  this
              test will fail for any files where the birth time is unknown.

Zubok ★★★★★
()

Сначала тебе надо установить zsh и прочитать документацию
Потом ввести следующие команду

ls *(mm3) # изменённые 3 минуты назад
ls *(mm-3) # меньше чем 3 минуты назад


В общем это сложно, забей

zolden ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.