find $PATH -mtime 0 查找距当前时间24小时以内修改的文件
Search for files in your home directory which have been modified in the last twenty-four hours. This command works this way because the time since each file was last modified is divided by 24 hours and any remainder is discarded. That means that to match -mtime 0, a file will have to have a modification in the past which is less than 24 hours ago.
find $PATH -mtime +n 查找距当前时间n天以外修改的文件
如n=2 find $PATH -mtime +2
当前时间11-10 10:00 那么即从距离当前时间(2012-11-10 10:00)的2天前开始算起 find $PATH -mtime +2表示11-07 10:00之前修改过的所有文件都会查找出来,往更早的时间推移,如底下参考鸟哥的时间推移图片
find $PATH -mtime -n 查找距当前时间n天以内修改的文件
如n=2 find $PATH -mtime -2 那么即从距离当前时间(2012-11-10 10:00)的2天前开始算起 find $PATH -mtime +2表示11-07 10:00之内修改过的所有文件都会查找出来,往现在的时间推移
find $PATH -mtime n 查询距当前时间n天之前24小时以内修改的文件
如n=2 当前时间为2012-11-10 10:00,往前推2天为2012-11-07 10:00,因此以此为时间点,24小时之内的时间为2012-11-07 10:00~2012-11-08 10:00 内修改的文件都会查找出来
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/2106.html