Linux command to check new files in file system

前端 未结 4 1968
栀梦
栀梦 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:41

    I misunderstood your question. Depending on what filesystem you are using, it may or may not store creation time.

    My understanding is that ext2/3/4 do not store creation time, but modified, changed (status, which is slightly different), and access times are.

    Fat32 on the other hand does contain creation timestamps IIRC.

    If you are using an ext filesystem, you have two options it seems:

    1.Settle for finding all of the files that were modified between two dates (which will include created files, but also files that were just edited). You could do this using find.

    2.Create a script/cronjob that will document the contents of your filesystem at some interval, e.g.

    find / > filesystem.$(date +%s).log
    

    and then run diffs to see what has been added. This, of course, would prevent you from looking backwards to time before you started making these logs.

提交回复
热议问题