Repairing Permissions in Mac OS X Using Unix Commands: Part I
The Basics
Every user on a Mac OS X system has a unique username and is a member of at least one group (the primary group for that user). A user can also be a member of one or more other groups. However, only the administrator can create new groups or add/delete group members
Directories are the "road maps" to access groups of files. Every directory and file on the system has an owner as well as an associated group. Directories and files also have a set of "permission flags" associated with them that specify separate read, write, and execute permissions for the 'user' (owner), 'group', and 'other' (everyone else with an account on the computer) for the file or directory, In the Terminal utility (which is usually found along the path "volumename/Applications/Utilities") several commands exist to handle file and permission manipulation.
First, open Terminal. Then set the directory (with the cd command) to point to the folder of files you want to manipulate. The pwd (print working directory) command can confirm that you are where you think you are. The ls (local storage) command shows the permissions and group associated with files when used with the -l option. Figure 1 shows how I got from the Terminal's default directory to the top level of my hard disk. Note that I used the change directory (cd(space)(period)(period)(return)) shortcut twice to get to a higher directory level than where I started.

Figure 1 Terminal's output from the ls command for a directory.