[plug] chown and chmod questions.

Carl Gherardi carl.gherardi at gmail.com
Thu Jan 11 22:19:22 WST 2007


On 1/11/07, Jonathan Young <jonathan at pcphix.com> wrote:
> On 1/11/2007, "Lee Jamieson" <leejam at gmail.com> wrote:
> >Do I put lee:lee as the username and group?
>
> Should work.  I personally use -R instead (just fewer keystrokes) and
> often you can use a group such as lee:administrators or similar, but
> what you have is OK.

Spot on: chown -R user:group directory

> >"chmod --recursive u+rw <directory>"

Thats the way i'd usually do it so I dont accidentally reset
additional permissions that others may have set on  files. Not so
important on a single user system though.

> Again, I use chmod with -R on the end.  I also tend to use 755 775 etc

As Alex said, that will make everything executable , something you
probably dont want.

640 or 644 to reset files and 750 or 755 for directories.

Something like:
find directory -type f -exec chmod 644 {} \;
find directory -type d -exec chmod 755 {} \;

(Queue others more efficient find without exec here :)

Carl G



More information about the plug mailing list