|
|
Terminal Commands: Changing Ownership. In MacOS X, every file has an owner. The owner can decide who has the right to read, modify, or execute any document or program which are his. While this is generally a great feature of Unix based operating systems, it can become quite a pain in the beginning for long time Mac users reorganizing files and folders while booted into Classic MacOS or as 'root' in MacOS X.. For example, as part of my move to MacOS X, I consolidated all my documents from all my applications into my home Documents folder. I did this while booted as 'root' in MacOS X. As a result, many of the documents in my /Users/coyle/Documents directory were not owned by coyle. I couldn't edit them! One such folder contained all my Quicken documents from the past eight years. If I were a loser without a life, I could open the "Get Info" window on every file and change the owner to coyle, but the White Sox are due to get beat by the Twins this evening, so I have places to go! The solution for changing ownership on a single file or an entire folder is with the terminal command: chown. Let's look at the example below. In the first image below, the file "INSTALLING README.rtf" is owned by root, not coyle. This means coyle cannot edit, move, and most importantly, delete this file.
To change the ownership to coyle, I typed the following:
Let's breakdown this command.
Notice in the image below that after typing the command, coyle is now the owner of the file. If I wanted to change the ownership of an entire directory, as in my Quicken example, place -R after the chown command:
If changing permissions is something you find yourself doing often, Laine Lee recommends a little utility called UpTowner. It allows a user with administrative privileges to temporarily become the owner of a file and its enclosing folder. It temporarily promotes you up to owner.
|
|||
|
||||||||||||||||||||||||||||||||
Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.
[an error occurred while processing this directive]