Linuxで特定の年または分より古いファイルを見つける方法

Linuxで特定の年または分より古いファイルを見つける方法

場合によっては、特定の年(1年など)より古いファイルを検索したい場合、-mtime +1引数を使用できます。 一方、特定の分(1分など)よりも古いファイルを検索する場合は、-mmin +1引数を使用できます。

man find

次の文を見つけます

       -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 mod?
              ification times.

1年以上前のファイルを見つける

find . -mtime +1

1分以上前のファイルを見つける

find . -mmin +1