Take the 2-minute tour ×

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?

share|improve this question

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

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

1 Answer 1

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.

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

Your Answer

