linux移动文件 速度慢,linux – 移动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分钟的文件.

手册页中的参考文献: –

-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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值