PDA

View Full Version : Permission Error. Terminal command for mass permission change?




fmartin2
Feb 3, 2012, 03:23 AM
I have moved files across to a computer on a network where i didn't log in as the admin before i moved them.

Now i have lots of files on the new computer that can't be opened because of various permission errors etc.
I don't have the old computer anymore.

I have tried putting them in a folder, setting the permissions right and clicking 'apply to enclosed items' but it didn't work.

It seems the problem comes from the 'everyone' being locked as the "custom access" permission.

So i was wondering, is there a terminal command that can set the permissions for the files right? If all of the troublesome files were on my desktop.

Freddie



willieva
Feb 3, 2012, 06:02 AM
In the folder you want to change:
chown -R $USER .
chmod -R +rw .

chown changes ownership, and will make the user who ran the command the owner.

-R means recursive, so all subfolders will be affected as well.

+rw means make the files readable and writeable by the user who issued the command. I'm just guessing that's what you want to do, you might have something else in mind.

You can do a 'man chmod' for more info.

fmartin2
Feb 3, 2012, 06:38 PM
great. got it, thanks!