How to move files returned in a find

carlarogers

Member
Joined
Jan 1, 2020
Messages
58
Reaction score
10
Credits
527
find . -iname *.log returns about 75 files in a certain directory tree.

I need to move all those files to a new location.

There must be an easy way to do this but I do not know what it is. I have searched but not found an answer.

Do you know a way to do this?
 
Last edited:


Try:
Code:
find . -iname '*.log' -exec mv '{}' /new/directory \;
where /new/directory is the directory you are sending the files to.
 

Members online


Latest posts

Top