Differences between revisions 3 and 4
Revision 3 as of 2009-01-21 17:39:23
Size: 856
Editor: tracker
Comment:
Revision 4 as of 2009-06-05 20:42:21
Size: 2007
Editor: platypus
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
 (use -R if you want to change the permissions of everything in a certain folder, otherwise just type a filename) [[BR]]
 (for example to change the group of the RAs folder to staff, in p/hlp I would type chgrp -R staff RAs) [[BR]]
 (use -R (which stands for "recursive") if you want to change the permissions of everything in a certain folder, otherwise just type a filename) [[BR]]
 (for example to change the group of the ```RAs``` folder to ```staff```, in ```/p/hlp/``` I would type ```chgrp -R staff RAs```) [[BR]]
Line 13: Line 13:

== chmod in detail ==
Unix files have three kinds of permissions (read, write, execute) for three parties (user, group, other). [[BR]]
On the command line:
 * The parties are abbreviated as u, g, and o.
 * The permissions are abbreviated as r, w, and x.
 * You give permissions with a + and take them away with a -
To give everyone full permission to a file:
{{{
chmod ugo+rwx filename
}}}
That's generally considered too much, so next we'll take away write and execute from other:
{{{
chmod o-wx filename
}}}
And then take away execute from the group:
{{{
chmod g-x filename
}}}
But to get that result in the first place we could do:
{{{
chmod g+rw filename
chmod o+r filename
}}}
What if you wanted to do that in one step? Well, it's possible. Permissions can also be set using a numerical system, where read = 4, write = 2, and execute = 1. The parties are represented positionally under this system in the order user, group, other. So to give full (rwx) permission to the user, read and write (rw) to the group and read (r) to other:
{{{
chmod 764 filename
}}}

How to change the group of a file want others to access

1. Go into terminal BR 2. Navigate to the folder you'd like to change permissions on using cd and ls. Use ls -l to find out what permissions currently exist on a certain file or folder. BR 3. Type in chgrp -R newgroupname foldername

  • (use -R (which stands for "recursive") if you want to change the permissions of everything in a certain folder, otherwise just type a filename) BR (for example to change the group of the RAs folder to staff, in /p/hlp/ I would type chgrp -R staff RAs) BR

4. To change permissions on a certain file, Use the chmod command. It will take arguments like chmod g+w RAs . This would allow everyone in the group "staff" to write things in the RAs folder.

1. chmod in detail

Unix files have three kinds of permissions (read, write, execute) for three parties (user, group, other). BR On the command line:

  • The parties are abbreviated as u, g, and o.
  • The permissions are abbreviated as r, w, and x.
  • You give permissions with a + and take them away with a -

To give everyone full permission to a file:

chmod ugo+rwx filename

That's generally considered too much, so next we'll take away write and execute from other:

chmod o-wx filename

And then take away execute from the group:

chmod g-x filename

But to get that result in the first place we could do:

chmod g+rw filename
chmod o+r filename

What if you wanted to do that in one step? Well, it's possible. Permissions can also be set using a numerical system, where read = 4, write = 2, and execute = 1. The parties are represented positionally under this system in the order user, group, other. So to give full (rwx) permission to the user, read and write (rw) to the group and read (r) to other:

chmod 764 filename

ChmodChgrp (last edited 2011-08-09 21:01:06 by echidna)

MoinMoin Appliance - Powered by TurnKey Linux