Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.