4.6. Using chown and chmod to Manage Permissions

You may often find yourself managing permissions from the command line. There are a few primary command line apps that you will use to do this: chown, chgrp and chmod. To change POSIX ownership of a file or folder, you use the chown utility. Its syntax is fairly straightforward:

chown owner[:group] /path to file

If all you're doing is changing ownership, you can omit the :group [the colon followed by the actual value for group]. Alternatively, you can use the chgrp command, which has similar syntax, but you instead provide the desired group name in the place of a user. OS X won't let just anyone change the owner of a file. To change ownership, you must either have granted the chown ACL right, ...

Get Enterprise Mac Security: Mac OS X Snow Leopard now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.