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.

Sreekumar Kj
Sreekumar (KJ) has been a hobby programmer from school days. Codemarvels is his personal blog from the year 2010, where he writes about technology, philosophy, society and a bit about physics. He now runs a conversational AI company - DheeYantra - focusing his efforts to help businesses improve operational efficiency using digital employees powered by AI.