【问题标题】:How can I move files from one folder to another created at specific date giving the creation date in redhat如何将文件从一个文件夹移动到另一个在特定日期创建的文件夹,给出 redhat 中的创建日期
【发布时间】:2023-01-02 16:17:11
【问题描述】:

我正在尝试使用终端使用创建日期将文件从一个文件夹移动到另一个文件夹。

我正在使用脚本

find /root/call_log/files23 -type f -newermt 2022-06-01 -not -newermt 2022-06-02 -exec mv {} /archive

/root/call_log/files23 is location ... /archive is destination but getting an error missing argument -exec. How can i fix it or is there a better way of doing it

【问题讨论】:

    标签: linux terminal


    【解决方案1】:

    man find 给我以下信息:

    -更新参考

    当前文件最后一次状态变化的时间比参考文件最后一次数据修改的时间更近。如果 reference 是一个符号链接并且 -H 选项或 -L 选项有效,那么总是使用它指向的文件的最后一次数据修改的时间。

    我建议你用这个代替-newermt。

    【讨论】:

      猜你喜欢
      • 2012-06-12
      • 1970-01-01
      • 2013-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多