Change ownership of files owned by only one user

To find all the files owned by a specific user and then change their group and user ownership to something else use the example in green and follow the directions on what to replace in the green example:

Replace enter_user_name_here with the specific user that you want to find.
Replace new_user with the user name by which you want the file to be owned.
Replace the new_group with the group name by which you want the file to be owned.

user@server the_directory> find . -user enter_user_name_here | xargs chown new_user:new_group

comments powered by Disqus