Linux.com

Re:chmod without binary counting

Posted by: Administrator on February 01, 2004 12:47 AM
Actually, "a" is for "all" meaning all three levels (user, group, others). Here's an example:
<TT>r--r-----    myfile.txt

chmod u+w myfile.txt
rw-r-----    myfile.txt

chmod g+w myfile.txt
rw-rw----    myfile.txt

chmod o+r myfile.txt
rw-rw-r--    myfile.txt

chmod a+x myfile.txt
rwxrwxr-x    myfile.txt</TT>

  • u = user
  • g = group
  • o = others
  • a = all


You can also combine the letters, like so:
<TT>chmod go-wx,u+w myfile.txt</TT>
you can also do this:
<TT>chmod u=rwx,g=rx,o=r myfile.txt</TT>
or this:
<TT>chmod ugo=rw myfile.txt</TT>
..and so on and so on.

#

Return to CLI magic: mother, may I?