Find all files from today recursively and copy them

I want to find all * .pdf files recursively in the / dir directory

There are certain files in this directory, such as / dir / 1 / 2.pdf [changed today], / dir / 2 / 3.pdf [changed today], / dir / 4 / 4.pdf [from yesterday]

In this case, I only need the files that were changed today like this: 2.pdf and 3.pdf

I also want to move these files to a directory named / pdf /

I found that I can find all the files in the current directory modified today using

find -maxdepth 1 -type f -mtime -1

How can I find files from today in subdirectories and move them to / pdf / dir?

Thank!!! Adam

+3
source share
1 answer

-maxdepth 1 find, -exec, :

find /dir -type f -mtime -1 -exec mv {} /pdf \;
+2

All Articles