Copying the files based on modification date in linux

后端 未结 5 406
小蘑菇
小蘑菇 2021-02-02 11:13

It may be a duplicate question but i could not find the solution for this i want to copy a last 3 months files from one directory to another directory but i could find only to l

5条回答
  •  旧时难觅i
    2021-02-02 11:19

    Use the -exec option for find:

    find . -mtime -90 -exec cp {} targetdir \;
    

    -exec would copy every result returned by find to the specified directory (targetdir in the above example).

提交回复
热议问题