I was wondering if there is a way to change the owner permissions of a file only is the owner is currently "fred" for example, leave all groups the same.

The reason for this is that I have recently been forced to login to SFTP via a different user and need to update all of the previous owned files to the new user. Although I dont want to change every files permissions.

link|improve this question

feedback

1 Answer

up vote 7 down vote accepted

Assuming that you have permission to change ownership, try this:

find /path/to/your/folder -user fred -exec chown <new_user> '{}' \;
link|improve this answer
1  
With the -R, if the matching file is a directory then all the files underneath get changed too whether they have the specified user or not. – Iain Aug 13 '11 at 14:00
OK. I've edited. – quanta Aug 13 '11 at 14:02
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.