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 –

[bash]

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

[/bash]

 

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

Kj
Kj [/.] Sreekumar programs computers as a hobby and profession. Into programming from his school days, Sree uses Codemarvels to key in facts and fixes he finds interesting while working on different projects. Some of the articles here give away a few shades of his philosophical leanings too.

Leave a Comment

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