Sometimes when I have to copy data to another machine it won’t let me access some of the files. There are two commands I try to get around this issue.

Of course you could check the man pages for chown or chmod but I will show you how I use them with my limited needs.

I will start with chown. I use this command to change the owner from what the files might think the former owner is, or is some case from who the owner actually was to me, or the new user. Here is how I do it.

Start by opening Terminal which is located in Applications > Utilities > Terminal, then use the following commands.

sudo chown -Rv user /filename/*

Here I use sudo to make sure I am running as the super user for this command, the -R (NOTE: the capital is important) is to make sure its recursive (meaning it will apply to child folders and files) and the -v is for verbose so that it will output what files the command is currently working on. I like verbose so that I know its still going and I can easily tell when its done. user refers to the user I want the ownership to pass to. /filename/* is the location of the file, on my Mac if I need to run the permission change on my music files I would use the short name of my account like:/Users/cwelker/Music/* I use the * out of habit to make sure it is going though the whole folder, which is what -r is doing as well, but it will not matter to have running both.

The other command I want to look at, I really only use when I am working with web design or installing some websites. I really only use this one way, and it opens the files wide open. I use this only when I need to, normally I can use my FTP programs to do the same thing, but either way here it is.

sudo chmod -rv 777 /filename/*

Some parts of this command will look familiar. The main difference is going to be that instead of one user you are modifying the files permissions for groups. The numbers refer to the user groups and what they can do with them. A better explination and a calculator of what the numbers can do can be found here

Comments and questions are always welcome and let me know if I can write something for you.