Linux command to check new files in file system

前端 未结 4 1965
栀梦
栀梦 2021-01-31 10:08

We have linux machine we would like to check what new files have been added between a certain date range.

I only have SSH access to this box and it\'s openSUSE 11.1

4条回答
  •  孤街浪徒
    2021-01-31 10:46

    There are bunch of ways for doing that.

    First one:

    start_date=201105040000

    end_date=201105042359

    touch -t ${start_date} start

    touch -t ${end_date} end

    find /you/path -type f -name '*you*pattern*' -newer start ! -newer end -exec ls -s {} \;

    Second one: find files modified between 20 and 21 days ago:

    find -ctime +20 -ctime -21

    finds files modified between 2500 and 2800 minutes ago:

    find -cmin +2500 -cmin -2800

    And read this topic too.

提交回复
热议问题