Find files in created between a date range

后端 未结 8 1083
遥遥无期
遥遥无期 2021-01-30 03:57

I use AIX via telnet here at work, and I\'d like to know how to find files in a specific folder between a date range. For example: I want to find all files in folder X that were

8条回答
  •  天涯浪人
    2021-01-30 04:32

    You can use the below to find what you need.

    Find files older than a specific date/time:

    find ~/ -mtime $(echo $(date +%s) - $(date +%s -d"Dec 31, 2009 23:59:59") | bc -l | awk '{print $1 / 86400}' | bc -l)
    

    Or you can find files between two dates. First date more recent, last date, older. You can go down to the second, and you don't have to use mtime. You can use whatever you need.

    find . -mtime $(date +%s -d"Aug 10, 2013 23:59:59") -mtime $(date +%s -d"Aug 1, 2013 23:59:59")
    

提交回复
热议问题