栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

移动30分钟前的文件

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

移动30分钟前的文件

您可以

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.


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/409015.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号