[olug] chown

Christopher Cashell topher-olug at zyp.org
Wed Sep 8 05:40:47 UTC 2010


On Wed, Sep 8, 2010 at 12:01 AM, Kelly Williams
<kellywilliams81 at gmail.com> wrote:
> I have a simple question. I just put a hard drive that I had migrated from a
> old computer and I shared it on my network. is there a way that i can change
> all the permissions of all directories and files instead of doing one at
> time.

Quickest and easiest way would be something like the following (from a
command line):

sudo find /mount/point/ -type d -print0 | xargs -0 chmod 775
sudo find /mount/point/ -type f -print0 | xargs -0 chmod 664

Change '/mount/point/' to the location where your hard drive is
mounted.  This will change all the directories so they are accessible
to anyone, and change all the files so they are readable by anyone.
You can change the 'chmod' command to 'chown' if you want to change
ownership on the files, too.

I seem to recall that you can mount a filesystem with an option to
make all files owned by a specific user, too, but I don't remember the
specifics of it offhand.

> Kelly Williams

-- 
Christopher



More information about the OLUG mailing list