Wednesday, June 27, 2012

change all those perms

So you need to change the uid on all files owned by user. Do the following as root:
# find / -uid 1500 -gid 100 -exec chown 15038:101 {} \;

A breakdown is as follows:

find / -uid 1500 -gid 100 -exec chown 1500:101 {} \;
^    ^      ^        ^       ^
|    |      |        |       |
|    |      |        |       | 
|    |      |        |       |
|    |      |        |       do this chown new userid:group {all files found}
|    |      |        |
|    |      |        user's primary group
|    |      |
|    |      userid
|    |
|    filesystem
|
command
Post a Comment