How to find all file owned by one user and copy them to another directory in RHEL 8?

1.4k Views Asked by At

Like I want to find all file owned by "user1" and copy those file to another folder "/root/found". Is this possible in redhat 8?

1

There are 1 best solutions below

1
On BEST ANSWER

Use find like so:

find /path/to/source/dir -user 'user1' -exec cp {} /root/found/ \;