您可以
find与
-exec此一起使用:-
根据需要替换
/sourcedirectory并
/destination/directory/使用源路径和目标路径。
find /sourcedirectory -maxdepth 1 -mmin -30 -type f -exec mv "{}" /destination/directory/ ;该命令的基本作用是,尝试在当前文件夹
-maxdepth 1中查找30分钟前最后一次修改的文件,
-mmin-30并将其移至指定的目标目录。如果要使用上次访问文件的时间,请使用
-amin -30。
或者,如果您想查找在一定范围内
-mmin 30 -mmin -35修改的文件,则可以使用类似于30分钟但不到35分钟之前的文件。
man页面引用:-
-amin n File was last accessed n minutes ago. -atime n File was last accessed n*24 hours ago. When find figures out how many 24-hour periods ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago. -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 modification times.



