Linux: Copy files owned by a user to another folder

Example

To copy all files owned by root in folder rpms to say folder docker-rpms, do this –


find rpms -user root -exec cp -f {} docker-rpms/ \;

 

Note: the destination folder needs to be created before running the command.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

53,709 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>