How can I write a script for finding the files created by a particular user ID in some locations and tar those files in the same location?

link|improve this question
feedback

migrated from stackoverflow.com Jul 13 '11 at 15:53

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 3 down vote accepted

Example creating a tarball of all files belonging to the root user anywhere beneath the current directory:

find . -uid 0 -print0|xargs -0 tar cf files-of-root-user.tar

You would replace -uid 0 with the id of the user you want to create the tar for.

link|improve this answer
Thank you soulmerge it worked. – user840963 Jul 12 '11 at 15:07
feedback

Your Answer

 
or
required, but never shown